    :root {
      --ink: #14122b;
      --muted: #4d4a66;
      --app-font: "Doctor Glitch";
      --layout-inline: clamp(10px, 2vw, 28px);
      --layout-block: clamp(12px, 2vh, 30px);
      --reveal-inline: clamp(14px, 2.2vw, 44px);
      --app-viewport-height: 100dvh;
      --app-viewport-width: 100dvw;
      --game-area-available-height: 100%;
      --reveal-vertical-reserve: clamp(96px, 14vh, 168px);
      --reveal-frame-size: min(88vmin, 760px);
      --character-tile-size: clamp(160px, min(34vw, 42vh), 430px);
      --cursor-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4.9' fill='%23f6f8ff' fill-opacity='0.94'/%3E%3Ccircle cx='12' cy='12' r='7.6' fill='none' stroke='%23080d16' stroke-opacity='0.62' stroke-width='1.4'/%3E%3C/svg%3E");
      --cursor-loupe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cdefs%3E%3CradialGradient id='lens' cx='34%25' cy='30%25' r='78%25'%3E%3Cstop offset='0%25' stop-color='%23ffffff' stop-opacity='0.9'/%3E%3Cstop offset='45%25' stop-color='%23e9f4ff' stop-opacity='0.64'/%3E%3Cstop offset='100%25' stop-color='%239ec0df' stop-opacity='0.3'/%3E%3C/radialGradient%3E%3ClinearGradient id='ring' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%23ffe8b2'/%3E%3Cstop offset='100%25' stop-color='%23c98d31'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='22' cy='22' r='14.6' fill='none' stroke='%2304070c' stroke-opacity='0.72' stroke-width='6.6'/%3E%3Ccircle cx='22' cy='22' r='12' fill='url(%23lens)' stroke='url(%23ring)' stroke-width='3.1'/%3E%3Cpath d='M31.8 31.8 L47.4 47.4' stroke='%2304070c' stroke-opacity='0.72' stroke-width='8.1' stroke-linecap='round'/%3E%3Cpath d='M31.8 31.8 L47.4 47.4' stroke='url(%23ring)' stroke-width='4.1' stroke-linecap='round'/%3E%3Cellipse cx='17.4' cy='15.7' rx='5' ry='2.8' fill='%23ffffff' fill-opacity='0.56'/%3E%3Cpath d='M35.2 35.2 L41 41' stroke='%23fff1d0' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    }

    /*
     * =========================================================
     * DESIGN TOKENS ET REGLAGES GLOBAUX
     * - Variables couleurs / typographie
     * - Curseurs personnalisés pour interactions fines
     * =========================================================
     */

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    /*
     * Cibles globales de confort interactif (desktop pointer fin)
     * et fallback cohérent sur les controles.
     */

    @media (pointer: fine) {
      html,
      body {
        cursor: var(--cursor-dot) 12 12, default;
      }

      body * {
        cursor: inherit;
      }

      a,
      button,
      [role="button"],
      [data-character],
      .portrait,
      .difficulty-btn,
      .action-btn,
      summary,
      label,
      select,
      input[type="button"],
      input[type="submit"],
      input[type="reset"] {
        cursor: var(--cursor-loupe) 22 22, pointer !important;
      }

      button:disabled,
      .action-btn:disabled,
      .difficulty-btn:disabled {
        cursor: var(--cursor-dot) 12 12, not-allowed !important;
      }
    }

    /*
     * ===== BASE LAYOUT =====
     * Arrière-plan et calques de base utilisés par toutes les vues.
     */
    html,
    body {
      min-height: 100%;
      min-height: 100dvh;
      height: var(--app-viewport-height);
      max-height: var(--app-viewport-height);
      width: 100%;
    }

    html {
      height: var(--app-viewport-height);
      min-height: var(--app-viewport-height);
      width: var(--app-viewport-width);
    }

    body {
      min-height: var(--app-viewport-height);
      max-height: var(--app-viewport-height);
      overflow: hidden;
      overscroll-behavior: none;
      display: block;
      place-items: initial;
      background: #0e1118;
      color: var(--ink);
      font-family: var(--app-font), serif;
      padding: calc(var(--layout-block) * 1.1) var(--layout-inline) calc(var(--layout-block) * 1.4);
      transition: background 0.18s steps(8), color 0.18s steps(6);
      position: relative;
    }

    body * {
      font-family: inherit;
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 0;
      opacity: 1;
      background-image:
        linear-gradient(180deg, rgba(6, 10, 18, 0.44) 0%, rgba(8, 12, 20, 0.24) 38%, rgba(5, 8, 14, 0.5) 100%),
        url("../assets/images/background.avif");
      background-position: 0 0, calc(50% - 200px) 50%;
      background-size: 100% 100%, 130% auto;
      background-repeat: no-repeat, no-repeat;
      background-blend-mode: multiply, normal;
      transform: none;
      filter: saturate(1.05) contrast(1.03);
    }

    body::after {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 1;
      opacity: 0;
      transition: opacity 0.18s steps(5);
    }

    /*
     * ===== EFFETS PLEIN ECRAN =====
     * 1) Effets Einstein / warp
     * 2) Effets Curie / bruit radiatif
     * 3) Effets Lamarr / ripples
     * 4) Effets Monka / matrix
     * 5) Décors Calcea / caps / geo / cristal
     */
    .radiation-noise-canvas {
      position: fixed;
      inset: 0;
      width: 100%;
      height: var(--app-viewport-height);
      pointer-events: none;
      z-index: 3;
      opacity: 0;
      image-rendering: pixelated;
      mix-blend-mode: screen;
      transition: opacity 0.12s steps(4);
    }

    .lamarr-ripple-canvas {
      position: fixed;
      inset: 0;
      width: 100%;
      height: var(--app-viewport-height);
      pointer-events: none;
      z-index: 1;
      opacity: 0;
      transition: opacity 0.16s steps(5);
      mix-blend-mode: screen;
    }

    .monka-matrix-canvas {
      position: fixed;
      inset: 0;
      width: 100%;
      height: var(--app-viewport-height);
      pointer-events: none;
      z-index: 0;
      opacity: 0;
      transition: opacity 0.16s steps(5);
      mix-blend-mode: screen;
    }

    .calcea-art {
      position: fixed;
      right: 0;
      bottom: clamp(36px, calc(3.4vh + 8px), 62px);
      min-width: 190px;
      width: min(27vw, 320px);
      max-width: 340px;
      display: block;
      pointer-events: none;
      z-index: 2;
      opacity: 0;
      transform: translate3d(0, 0, 0);
      transform-origin: 100% 100%;
      transition: opacity 0.18s steps(5), transform 0.18s steps(5);
      filter:
        drop-shadow(0 18px 28px rgba(5, 10, 28, 0.22))
        drop-shadow(0 0 20px rgba(255, 214, 79, 0.08));
    }

    .calcea-art img {
      display: block;
      width: 100%;
      height: auto;
      transform: translateY(-2%);
    }

    .calcea-geometry {
      position: fixed;
      inset: 0;
      overflow: hidden;
      pointer-events: none;
      z-index: 1;
      opacity: 0;
      transition: opacity 0.18s steps(5);
    }

    .calcea-geometry svg {
      display: block;
      width: 100%;
      height: 100%;
    }

    .calcea-bg-triangle {
      opacity: 0.88;
      stroke: rgba(16, 38, 86, 0.28);
      stroke-width: 0.8;
      vector-effect: non-scaling-stroke;
    }

    .calcea-triangle-fill {
      fill: rgba(255, 255, 255, 0.16);
      opacity: 0.3;
    }

    .calcea-triangle-trace {
      fill: none;
      stroke: rgba(255, 250, 255, 0.9);
      stroke-width: 1.8;
      stroke-linecap: round;
      stroke-linejoin: round;
      stroke-dasharray: 100;
      stroke-dashoffset: 100;
      opacity: 0;
      filter: url(#calceaTraceGlow);
      animation: calceaTriangleTrace var(--duration, 8.8s) linear infinite;
      animation-delay: var(--delay, 0s);
    }

    .calcea-triangle-angle {
      fill: rgba(255, 255, 255, 0.96);
      opacity: 0;
      filter: url(#calceaTraceGlow);
      animation: calceaTriangleSquare var(--duration, 8.8s) linear infinite;
      animation-delay: var(--delay, 0s);
      transform-box: fill-box;
      transform-origin: center;
    }

    .calcea-caps {
      display: none;
      position: fixed;
      inset: 0;
      overflow: hidden;
      pointer-events: none;
      z-index: 3;
      opacity: 0;
      transition: opacity 0.16s steps(5);
      perspective: 1400px;
      transform-style: preserve-3d;
    }

    .calcea-cap {
      position: absolute;
      left: var(--left);
      bottom: 4vh;
      display: block;
      width: var(--size);
      aspect-ratio: 1 / 0.84;
      opacity: 1;
      transform-origin: 50% 50%;
      will-change: transform, opacity;
      transform-style: preserve-3d;
      transform:
        translate3d(var(--cap-x, 0px), var(--cap-y, 0px), var(--cap-z, 0px))
        rotateX(var(--cap-rx, 0deg))
        rotateY(var(--cap-ry, 0deg))
        rotateZ(var(--cap-rz, 0deg))
        scale(var(--cap-scale, 1));
    }

    .calcea-cap .cap-visual {
      position: relative;
      display: block;
      width: 100%;
      height: 100%;
      perspective: 820px;
      perspective-origin: 50% 46%;
      transform-style: preserve-3d;
      filter:
        drop-shadow(0 14px 24px rgba(12, 18, 34, 0.22))
        drop-shadow(0 3px 7px rgba(12, 18, 34, 0.16));
    }

    .calcea-cap .cap-full {
      position: absolute;
      inset: 0;
      display: block;
      z-index: 2;
      opacity: 1;
      transform-style: preserve-3d;
    }

    .calcea-cap .cap-model {
      position: absolute;
      left: 50%;
      top: 50%;
      width: 0;
      height: 0;
      transform-style: preserve-3d;
      transform: translate3d(0, var(--model-offset-y, 0px), 0);
    }

    .calcea-cap .cap-floor-shadow {
      position: absolute;
      left: 50%;
      top: 50%;
      width: calc(var(--board-size, 52px) * 0.86);
      height: calc(var(--board-size, 52px) * 0.86);
      border-radius: 50%;
      background: radial-gradient(circle, rgba(3, 5, 9, 0.34) 0%, rgba(3, 5, 9, 0.18) 34%, rgba(3, 5, 9, 0) 72%);
      transform: translate(-50%, -50%) rotateX(90deg) translateZ(calc(var(--crown-height, 18px) * -1.08));
      filter: blur(5px);
      opacity: 0.72;
      pointer-events: none;
    }

    .calcea-cap .cap-board {
      position: absolute;
      left: 0;
      top: 0;
      width: 0;
      height: 0;
      transform-style: preserve-3d;
      transform: translate3d(0, calc(var(--crown-height, 18px) * -0.4), 0) rotateY(45deg);
    }

    .calcea-cap .cap-board-face,
    .calcea-cap .cap-board-side {
      position: absolute;
      left: 50%;
      top: 50%;
      backface-visibility: hidden;
      transform-style: preserve-3d;
    }

    .calcea-cap .cap-board-face {
      width: var(--board-size, 52px);
      height: var(--board-size, 52px);
      border: 1px solid rgba(187, 196, 220, 0.08);
    }

    .calcea-cap .cap-board-top {
      background:
        linear-gradient(140deg, rgba(127, 139, 162, 0.96) 0%, rgba(56, 62, 75, 0.98) 32%, rgba(19, 23, 31, 1) 100%);
      box-shadow:
        inset 0 1px 0 rgba(228, 233, 244, 0.2),
        inset -12px -12px 16px rgba(0, 0, 0, 0.18);
      transform: translate(-50%, -50%) rotateX(90deg) translateZ(var(--board-half-thickness, 3px));
    }

    .calcea-cap .cap-board-bottom {
      background: linear-gradient(180deg, rgba(28, 33, 42, 0.98) 0%, rgba(7, 10, 14, 1) 100%);
      transform: translate(-50%, -50%) rotateX(90deg) translateZ(calc(var(--board-half-thickness, 3px) * -1));
    }

    .calcea-cap .cap-board-shine {
      position: absolute;
      left: 50%;
      top: 50%;
      width: calc(var(--board-size, 52px) * 0.74);
      height: calc(var(--board-size, 52px) * 0.74);
      background: linear-gradient(140deg, rgba(234, 240, 255, 0.24) 0%, rgba(255, 255, 255, 0.04) 26%, rgba(255, 255, 255, 0) 72%);
      border-radius: 4px;
      transform: translate(-50%, -50%) rotateX(90deg) translateZ(calc(var(--board-half-thickness, 3px) + 1px));
      pointer-events: none;
    }

    .calcea-cap .cap-board-side {
      border: 1px solid rgba(133, 144, 168, 0.08);
    }

    .calcea-cap .cap-board-side--front,
    .calcea-cap .cap-board-side--back {
      width: var(--board-size, 52px);
      height: var(--board-thickness, 6px);
      background: linear-gradient(180deg, rgba(74, 82, 98, 0.95) 0%, rgba(15, 18, 25, 1) 100%);
    }

    .calcea-cap .cap-board-side--front {
      transform: translate(-50%, calc(-50% - var(--board-half-thickness, 3px))) translateZ(var(--board-half, 26px));
    }

    .calcea-cap .cap-board-side--back {
      transform: translate(-50%, calc(-50% - var(--board-half-thickness, 3px))) translateZ(calc(var(--board-half, 26px) * -1)) rotateY(180deg);
    }

    .calcea-cap .cap-board-side--left,
    .calcea-cap .cap-board-side--right {
      width: var(--board-size, 52px);
      height: var(--board-thickness, 6px);
      background: linear-gradient(180deg, rgba(61, 69, 83, 0.96) 0%, rgba(11, 14, 20, 1) 100%);
    }

    .calcea-cap .cap-board-side--left {
      transform: translate(-50%, calc(-50% - var(--board-half-thickness, 3px))) rotateY(90deg) translateZ(var(--board-half, 26px));
    }

    .calcea-cap .cap-board-side--right {
      transform: translate(-50%, calc(-50% - var(--board-half-thickness, 3px))) rotateY(-90deg) translateZ(var(--board-half, 26px));
    }

    .calcea-cap .cap-crown {
      position: absolute;
      left: 0;
      top: 0;
      width: 0;
      height: 0;
      transform-style: preserve-3d;
      transform: translate3d(0, calc(var(--crown-height, 18px) * 0.34), 0);
    }

    .calcea-cap .cap-crown-panel,
    .calcea-cap .cap-crown-top,
    .calcea-cap .cap-crown-hole,
    .calcea-cap .cap-crown-bottom {
      position: absolute;
      left: 50%;
      top: 50%;
      backface-visibility: hidden;
      transform-style: preserve-3d;
    }

    .calcea-cap .cap-crown-panel {
      width: var(--crown-segment, 9px);
      height: var(--crown-height, 18px);
      border-radius: 999px;
      background:
        linear-gradient(180deg, rgba(106, 117, 138, 0.98) 0%, rgba(49, 56, 70, 0.98) 38%, rgba(17, 21, 28, 1) 100%);
      box-shadow:
        inset 1px 0 0 rgba(223, 229, 242, 0.14),
        inset -1px 0 0 rgba(0, 0, 0, 0.26);
      transform: translate(-50%, -50%) rotateY(var(--panel-rot, 0deg)) translateZ(var(--crown-radius, 12px));
    }

    .calcea-cap .cap-crown-top,
    .calcea-cap .cap-crown-bottom {
      width: var(--crown-diameter, 24px);
      height: var(--crown-diameter, 24px);
      border-radius: 50%;
    }

    .calcea-cap .cap-crown-top {
      background: radial-gradient(circle, rgba(138, 147, 170, 1) 0 34%, rgba(82, 89, 103, 0.98) 35% 52%, rgba(16, 19, 25, 1) 53% 100%);
      transform: translate(-50%, -50%) translateY(calc(var(--crown-half-height, 9px) * -1)) rotateX(90deg);
      box-shadow: 0 0 0 1px rgba(185, 194, 220, 0.08);
    }

    .calcea-cap .cap-crown-hole {
      width: calc(var(--crown-diameter, 24px) * 0.42);
      height: calc(var(--crown-diameter, 24px) * 0.42);
      border-radius: 50%;
      background: radial-gradient(circle, rgba(2, 3, 6, 1) 0%, rgba(9, 11, 17, 1) 100%);
      transform: translate(-50%, -50%) translateY(calc(var(--crown-half-height, 9px) * -1)) rotateX(90deg) translateZ(1px);
    }

    .calcea-cap .cap-crown-bottom {
      background: radial-gradient(circle, rgba(54, 61, 73, 0.95) 0%, rgba(9, 12, 16, 1) 100%);
      transform: translate(-50%, -50%) translateY(var(--crown-half-height, 9px)) rotateX(90deg);
    }

    .calcea-cap .cap-button {
      position: absolute;
      left: 50%;
      top: 50%;
      width: var(--button-size, 6px);
      height: var(--button-size, 6px);
      border-radius: 50%;
      background: radial-gradient(circle, rgba(74, 82, 98, 1) 0%, rgba(18, 22, 30, 1) 72%);
      border: 1px solid rgba(188, 197, 220, 0.14);
      transform: translate(-50%, -50%) translateY(calc(var(--crown-height, 18px) * -0.72)) rotateX(90deg) translateZ(calc(var(--board-half-thickness, 3px) + 1px));
      box-shadow: 0 0 0 1px rgba(11, 14, 18, 0.28);
    }

    .calcea-cap .cap-half {
      position: absolute;
      inset: 0;
      display: block;
      opacity: 0;
      z-index: 2;
      transform: translate(var(--half-left-x, 0px), var(--half-left-y, 0px)) rotate(var(--half-left-rot, 0deg)) scale(var(--half-left-scale, 1));
      transform-origin: 50% 50%;
    }

    .calcea-cap .cap-half svg {
      width: 100%;
      height: 100%;
      display: block;
      overflow: visible;
    }

    .calcea-cap .cap-half.left {
      transform: translate(var(--half-left-x, 0px), var(--half-left-y, 0px)) rotate(var(--half-left-rot, 0deg)) scale(var(--half-left-scale, 1));
    }

    .calcea-cap .cap-half.right {
      transform: translate(var(--half-right-x, 0px), var(--half-right-y, 0px)) rotate(var(--half-right-rot, 0deg)) scale(var(--half-right-scale, 1));
    }

    .calcea-cap.is-split .cap-full {
      opacity: 0;
    }

    .calcea-cap.is-split .cap-half {
      opacity: 1;
    }

    .curie-crystal {
      position: fixed;
      right: 0;
      bottom: 0;
      width: clamp(264px, 28vw, 456px);
      aspect-ratio: 1 / 1;
      display: block;
      pointer-events: none;
      z-index: 0;
      opacity: 0;
      transform: scale(1);
      transition: opacity 0.12s steps(4);
      mix-blend-mode: normal;
      filter: drop-shadow(0 0 8px rgba(145, 236, 110, 0.28));
      isolation: isolate;
    }

    .curie-crystal::before {
      content: "";
      position: absolute;
      inset: 0;
      background: url("../assets/images/uranium.png") 100% 100% / contain no-repeat;
      filter: blur(1.2px);
      opacity: 0.92;
    }

    .curie-crystal::after {
      content: "";
      position: absolute;
      inset: -18%;
      border-radius: 50%;
      background:
        radial-gradient(circle at 50% 50%, rgba(201, 255, 164, 0.72) 0%, rgba(149, 245, 113, 0.34) 20%, rgba(86, 188, 64, 0.18) 38%, rgba(32, 72, 29, 0.1) 52%, rgba(0, 0, 0, 0) 70%);
      filter: blur(5.5px);
      opacity: 0.58;
      z-index: 1;
    }

    .warp-canvas {
      position: fixed;
      inset: 0;
      width: 100%;
      height: var(--app-viewport-height);
      image-rendering: pixelated;
      pointer-events: none;
      z-index: 1;
      opacity: 0;
      transition: opacity 0.14s steps(6);
      mix-blend-mode: screen;
    }

    /*
     * ===== STRUCTURE DE PAGES =====
     * Container principal + zone hero (titre + zone de jeu).
     */
    .container {
      min-height: 0;
      height: min(100%, var(--app-viewport-height));
      min-height: min(100%, var(--app-viewport-height));
      position: relative;
      z-index: 2;
      width: min(100%, 1100px);
      max-width: 1100px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
    }

    .hero {
      min-height: 0;
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      background: transparent;
      border: 0;
      box-shadow: none;
      padding: clamp(72px, 11vh, 112px) 0 clamp(2px, 0.5vh, 6px);
      position: relative;
    }

    .selection-title-zone {
      position: fixed;
      top: clamp(6px, 1.6vh, 14px);
      left: 50%;
      transform: translateX(-50%);
      display: inline-block;
      z-index: 31;
    }

    .game-title {
      width: auto;
      margin: 0;
      padding: 0;
      text-align: center;
      display: inline-block;
      line-height: 1.1;
      letter-spacing: 0.06em;
      font-size: clamp(2rem, 5vw, 3.15rem);
      color: #4fb0ff;
      text-shadow:
        0 2px 0 #0f2942,
        0 4px 0 #0a1b2c,
        0 8px 16px rgba(0, 0, 0, 0.5),
        0 0 14px rgba(91, 175, 255, 0.55);
    }

    .student-identity-row {
      position: absolute;
      left: 50%;
      top: clamp(58px, 9vh, 98px);
      transform: translateX(-50%);
      margin: 0;
      width: fit-content;
      max-width: min(94vw, 760px);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      color: rgba(236, 244, 255, 0.9);
      font-family: Calibri, Arial, sans-serif;
      font-size: clamp(0.72rem, 1.2vw, 0.9rem);
      line-height: 1.2;
      letter-spacing: 0.02em;
      z-index: 25;
      white-space: nowrap;
    }

    .student-identity-row[hidden] {
      display: none !important;
    }

    .student-name-tag {
      display: inline;
      margin: 0;
      text-align: center;
      font-family: Calibri, Arial, sans-serif;
      font-size: inherit;
      line-height: inherit;
      letter-spacing: inherit;
      color: inherit;
      white-space: nowrap;
    }

    .student-name-tag[hidden] {
      display: none !important;
    }

    .classmate-add-btn {
      width: 26px;
      height: 26px;
      border-radius: 999px;
      border: 1px solid #1f1d2d;
      background: #fef8e5;
      color: #1f1d2d;
      font: 700 19px/1 Calibri, Arial, sans-serif;
      cursor: pointer;
      box-shadow: 1px 1px 0 #181726;
      flex: 0 0 auto;
    }

    .participants-count {
      display: inline;
      white-space: nowrap;
      color: rgba(236, 244, 255, 0.98);
      text-decoration: underline dotted rgba(236, 244, 255, 0.65);
      text-underline-offset: 2px;
      cursor: help;
    }

    .participants-count[hidden] {
      display: none !important;
    }

    .selection-auth-zone {
      position: fixed;
      top: clamp(6px, 1.6vh, 14px);
      right: clamp(8px, 2vw, 24px);
      max-width: min(42vw, 320px);
      z-index: 30;
      display: inline-block;
      white-space: nowrap;
      text-align: right;
    }

    .selection-reset-zone {
      position: fixed;
      top: clamp(6px, 1.6vh, 14px);
      left: clamp(8px, 2vw, 24px);
      max-width: min(42vw, 320px);
      z-index: 30;
      display: inline-block;
      white-space: nowrap;
    }

    .selection-reset-zone[hidden] {
      display: none !important;
    }

    .selection-auth-btn {
      border: 3px solid #1f1d2d;
      background: #fef8e5;
      box-shadow: 4px 4px 0 #181726;
      color: #1f1d2d;
      font-size: clamp(1rem, 2vw, 1.22rem);
      font-weight: 700;
      line-height: 1.2;
      min-height: 42px;
      padding: 8px 12px;
      max-width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      cursor: pointer;
      font-family: Calibri, Arial, sans-serif;
      transition: transform 0.12s steps(2), box-shadow 0.12s steps(2), background 0.12s steps(2);
    }

    .selection-auth-btn:hover,
    .selection-auth-btn:focus-visible {
      transform: translate(-2px, -2px);
      box-shadow: 6px 6px 0 #181726;
      background: #fffef4;
      outline: none;
    }

    .selection-reset-btn {
      border-color: #2a1a1a;
      color: #2a1a1a;
      background: #fdeaea;
      box-shadow: 4px 4px 0 #2a1a1a;
    }

    .selection-reset-btn:hover,
    .selection-reset-btn:focus-visible {
      background: #fff3f3;
      box-shadow: 6px 6px 0 #2a1a1a;
    }

    .floating-hole {
      position: fixed;
      left: 50%;
      top: 50%;
      width: clamp(210px, 27vw, 420px);
      aspect-ratio: 1040 / 600;
      transform: translate(-50%, -50%) scale(0.9);
      opacity: 0;
      pointer-events: none;
      z-index: 1;
      transition: opacity 0.2s steps(6), transform 0.2s steps(6);
      overflow: hidden;
      background: transparent;
      -webkit-mask-image: radial-gradient(ellipse at center, #000 0 76%, rgba(0, 0, 0, 0.96) 86%, rgba(0, 0, 0, 0.74) 93%, transparent 100%);
      mask-image: radial-gradient(ellipse at center, #000 0 76%, rgba(0, 0, 0, 0.96) 86%, rgba(0, 0, 0, 0.74) 93%, transparent 100%);
    }

    .floating-hole .hole-gif {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
      object-position: 50% 50%;
      image-rendering: auto;
      mix-blend-mode: normal;
      opacity: 1;
      filter: none;
    }

    .hint {
      display: none;
    }

    .visually-hidden {
      position: absolute !important;
      width: 1px !important;
      height: 1px !important;
      margin: -1px !important;
      border: 0 !important;
      padding: 0 !important;
      white-space: nowrap !important;
      clip-path: inset(50%) !important;
      clip: rect(0, 0, 0, 0) !important;
      overflow: hidden !important;
    }

    /*
     * ===== ECHELLE DE JEU =====
     * Gestion des vues (portraits / difficulty / reveal) via [hidden].
     */
    .game-area {
      flex: 1;
      margin-top: clamp(4px, 1.4vh, 14px);
      min-height: 0;
      height: var(--game-area-available-height, auto);
      max-height: min(100%, var(--game-area-available-height, 100%));
      padding-bottom: 0;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      overflow: hidden;
      position: relative;
      width: 100%;
      scrollbar-width: none;
      -ms-overflow-style: none;
      overscroll-behavior: none;
      touch-action: none;
    }

    .stage-view {
      position: relative;
      height: 100%;
      flex: 1;
      z-index: 2;
      min-height: 0;
      max-height: 100%;
      overflow: hidden;
      scrollbar-width: none;
      -ms-overflow-style: none;
      overscroll-behavior: none;
      touch-action: none;
    }

    .stage-view[hidden] {
      display: none;
    }

    /*
     * ===== VUE DE SELECTION DES PERSONNAGES =====
     * Grille responsive, cartes + indicateurs d'avancement.
     */
    .portraits {
      display: grid;
      grid-template-columns: repeat(3, auto);
      justify-content: center;
      justify-items: center;
      align-items: start;
      align-content: start;
      gap: 10px;
      width: fit-content;
      max-width: 100%;
      margin-inline: auto;
    }

    .portraits > .portrait {
      width: min(100%, var(--character-tile-size));
      max-width: var(--character-tile-size);
    }

    .portrait {
      --tilt-x: 0deg;
      --tilt-y: 0deg;
      background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.1) 42%, rgba(180, 209, 241, 0.08) 100%);
      border: 1px solid rgba(223, 235, 255, 0.55);
      box-shadow:
        0 12px 26px rgba(9, 17, 36, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
      border-radius: 14px;
      overflow: hidden;
      transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
      text-align: center;
      transform-style: preserve-3d;
      transform: perspective(920px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(0);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
    }

    .portrait::before {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      background:
        linear-gradient(125deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.08) 24%, rgba(255, 255, 255, 0.02) 54%, rgba(255, 255, 255, 0) 70%);
      mix-blend-mode: screen;
      z-index: 1;
    }

    .portrait:hover,
    .portrait:focus-within {
      transform: perspective(920px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(-4px);
      box-shadow:
        0 16px 30px rgba(8, 18, 40, 0.31),
        inset 0 1px 0 rgba(255, 255, 255, 0.34);
      border-color: rgba(236, 244, 255, 0.78);
    }

    .portrait img {
      display: block;
      width: 100%;
      aspect-ratio: 1 / 1;
      object-fit: cover;
      image-rendering: pixelated;
      filter: contrast(1.1) saturate(0.9);
      position: relative;
      z-index: 0;
    }

    .character-card {
      position: relative;
      isolation: isolate;
    }

    .character-card img {
      filter: none;
    }

    .qr-card {
      position: relative;
      isolation: isolate;
      aspect-ratio: 1 / 1;
      background:
        radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.08) 26%, rgba(130, 194, 255, 0.1) 54%, rgba(11, 21, 48, 0.92) 100%),
        linear-gradient(180deg, rgba(7, 14, 30, 0.94) 0%, rgba(11, 22, 48, 0.98) 100%);
      border-color: rgba(180, 225, 255, 0.5);
    }

    .qr-card-link {
      position: relative;
      z-index: 1;
      display: grid;
      align-content: center;
      justify-items: center;
      gap: 0;
      width: 100%;
      min-height: 100%;
      padding: 18px 16px;
      color: #eef7ff;
      text-decoration: none;
    }

    .qr-card-link::before {
      content: "";
      position: absolute;
      inset: 10px;
      border-radius: 12px;
      border: 1px solid rgba(195, 233, 255, 0.18);
      background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 48%),
        radial-gradient(circle at 50% 18%, rgba(117, 215, 255, 0.16) 0%, rgba(117, 215, 255, 0) 56%);
      pointer-events: none;
    }

    .qr-card-link > * {
      position: relative;
      z-index: 1;
    }

    .qr-card-code {
      width: min(100%, 182px);
      aspect-ratio: 1 / 1;
      display: block;
      padding: 10px;
      border-radius: 12px;
      background: #ffffff;
      box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.32);
      object-fit: contain;
      image-rendering: auto;
      filter: none;
    }

    .einstein-card {
      cursor: pointer;
    }

    .card-progress {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      z-index: 2;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
      pointer-events: none;
    }

    .progress-pill {
      border: 1px solid rgba(228, 238, 255, 0.44);
      background: rgba(18, 27, 49, 0.48);
      color: #d9e9ff;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
      padding: 4px 5px 3px;
      border-radius: 8px;
      display: grid;
      justify-items: center;
      gap: 1px;
      line-height: 1;
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
    }

    .progress-pill .label {
      font-size: clamp(0.56rem, 1.1vw, 0.65rem);
      letter-spacing: 0.02em;
      color: #c6d8f4;
      text-transform: uppercase;
    }

    .progress-pill .value {
      font-size: clamp(1rem, 1.9vw, 1.22rem);
      color: #f2f8ff;
      text-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
    }

    .einstein-card img {
      object-position: center 20%;
    }

    .locked {
      opacity: 0.88;
    }

    .placeholder {
      aspect-ratio: 3 / 4;
      display: grid;
      place-items: center;
      font-size: clamp(2.4rem, 5vw, 3.2rem);
      color: #6a677f;
      background: repeating-linear-gradient(0deg, #dfd9c0 0, #dfd9c0 8px, #ece5cd 8px, #ece5cd 16px);
    }

    /*
     * ===== VUE DE DIFFICULTE + REVEAL =====
     * Boutons de difficulté, layout portrait/indices, actions.
     */
    .difficulty-view,
    .reveal-view {
      min-height: 0;
      height: auto;
      display: grid;
      justify-items: center;
      align-content: start;
      gap: 14px;
      padding: 10px 6px 16px;
    }

    .reveal-view {
      position: relative;
      grid-template-rows: 1fr;
      align-content: start;
      padding: 2px 0 0;
      width: 100%;
      overflow-y: auto;
      overflow-x: hidden;
      max-height: 100%;
      overscroll-behavior-y: contain;
      touch-action: pan-y;
      -webkit-overflow-scrolling: touch;
    }

    .reveal-title {
      display: none;
    }

    #revealView {
      display: none;
      justify-content: center;
      align-items: flex-start;
    }

    #revealView:not([hidden]) {
      display: flex;
    }

    #revealView[hidden] {
      display: none !important;
    }

    .reveal-core {
      display: none;
    }

    .reveal-view.is-ready .reveal-core {
      position: relative;
      width: min(96vw, var(--reveal-frame-size));
      max-width: min(96vw, 100%);
      margin: 0 auto;
      display: block;
      justify-items: center;
      align-content: start;
    }

    .reveal-progress-wrap {
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      width: min(88%, 520px);
      z-index: 11;
      display: grid;
      gap: 8px;
      justify-items: center;
      margin: 0;
      padding: 8px 10px;
      border: 3px solid #1f1d2d;
      background: rgba(14, 15, 22, 0.68);
      box-shadow: 2px 3px 0 #181726;
      pointer-events: none;
    }

    .reveal-topbar {
      position: absolute;
      top: 8px;
      left: 12px;
      right: 12px;
      z-index: 17;
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      grid-template-areas: "portrait progress actions";
      gap: 10px;
      align-items: start;
    }

    .reveal-topbar .reveal-progress-wrap {
      grid-area: progress;
      position: static;
      top: auto;
      left: auto;
      transform: none;
      width: 100%;
      min-width: 0;
      margin: 0;
      padding: 0;
      border: 0;
      box-shadow: none;
      background: transparent;
      pointer-events: auto;
    }

    .reveal-topbar .reveal-progress-wrap .reveal-progress {
      width: 100%;
      text-wrap: balance;
    }

    .reveal-topbar .reveal-actions {
      grid-area: actions;
      position: static;
      width: auto;
      left: auto;
      right: auto;
      top: auto;
      display: flex;
      justify-content: flex-end;
      pointer-events: auto;
    }

    .reveal-topbar #togglePortraitBtn {
      grid-area: portrait;
      justify-self: start;
      width: auto;
      min-width: min(180px, 34vw);
      margin: 0;
      position: relative;
      z-index: auto;
    }

    .reveal-topbar #changeDifficultyBtn {
      margin-right: 6px;
    }

    .reveal-topbar.is-progress-below {
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-areas:
        "portrait actions"
        "progress progress";
      row-gap: 14px;
      column-gap: 8px;
      align-items: center;
      padding-bottom: 10px;
    }

    .reveal-topbar.is-progress-below .reveal-progress-wrap {
      width: 100%;
      justify-self: stretch;
      margin-top: 8px;
      margin-bottom: 12px;
      padding-top: 6px;
      padding-bottom: 8px;
    }

    .reveal-view.is-riddle-mode .reveal-topbar.is-progress-below ~ .riddle-section {
      margin-top: 0 !important;
      top: calc(clamp(67px, 8.1vh, 86px) + 42px) !important;
    }

    @media (max-width: 760px) {
      .reveal-view.is-riddle-mode .reveal-topbar.is-progress-below ~ .riddle-section {
        top: calc(clamp(58px, 8vh, 74px) + 46px) !important;
      }
    }

    @media (max-width: 560px) {
      .reveal-view.is-riddle-mode .reveal-topbar.is-progress-below ~ .riddle-section {
        top: calc(clamp(56px, 8.5vh, 70px) + 50px) !important;
      }
    }

    .reveal-progress-wrap .reveal-progress {
      text-align: justify;
      text-align-last: left;
      color: #111111;
      font-size: clamp(0.86rem, 1.7vw, 1rem);
      letter-spacing: 0.02em;
      text-transform: none;
      margin: 0;
    }

    .reveal-frame-wrap {
      position: relative;
      width: min(100%, var(--reveal-frame-size));
      aspect-ratio: 1 / 1;
      min-height: 0;
      margin: 0 auto;
      display: block;
      isolation: isolate;
    }

    .reveal-content {
      width: 100%;
      height: 100%;
      aspect-ratio: 1 / 1;
      border: 3px solid #1f1d2d;
      background: rgba(0, 0, 0, 0.06);
      box-shadow: 6px 8px 0 #16152a;
      display: grid;
      place-items: stretch;
      justify-items: center;
      padding: 0;
      overflow: hidden;
      position: relative;
    }

    .reveal-view.is-riddle-mode .pixel-frame {
      display: none;
    }

    .reveal-view.is-riddle-mode .reveal-frame-wrap {
      background: #f4e8c8;
      border: 3px solid #1f1d2d;
      box-shadow: 6px 8px 0 #16152a;
    }

    .reveal-view.is-riddle-mode .reveal-content {
      background: #f4e8c8;
    }

    .reveal-nav {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      z-index: 8;
      width: clamp(42px, 5vw, 56px);
      height: clamp(72px, 12vh, 88px);
      border: 3px solid #1f1d2d;
      background: #fef8e5;
      box-shadow: 2px 4px 0 #181726;
      font-size: clamp(1.1rem, 2.4vw, 1.5rem);
      color: #1f1d2d;
      display: grid;
      place-items: center;
      cursor: pointer;
      transition: transform 0.12s steps(2), box-shadow 0.12s steps(2);
      padding: 0;
      line-height: 1;
      min-height: 0;
      min-width: 0;
      user-select: none;
    }

    .reveal-nav:hover,
    .reveal-nav:focus-visible {
      transform: translateY(-50%) translateX(-2px);
      box-shadow: 4px 6px 0 #181726;
    }

    .reveal-nav-left {
      left: 0;
      border-right-width: 2px;
    }

    .reveal-nav-right {
      right: 0;
      border-left-width: 2px;
    }

    .panel-title {
      font-size: clamp(0.8rem, 2vw, 1rem);
      text-align: justify;
      text-align-last: left;
      line-height: 1.6;
      letter-spacing: 0.03em;
      color: #ece0c3;
    }

    .difficulty-view .panel-title {
      text-align: center;
      text-align-last: center;
    }

    .panel-subtitle {
      text-align: justify;
      text-align-last: left;
      color: #cfbf9f;
      font-size: clamp(1rem, 1.9vw, 1.2rem);
    }

    .difficulty-grid {
      width: min(780px, 100%);
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 12px;
    }

    .difficulty-actions {
      display: flex;
      justify-content: center;
      width: 100%;
      margin-top: 6px;
    }

    .difficulty-btn {
      border: 3px solid #1f1d2d;
      background: #fef8e5;
      box-shadow: 4px 4px 0 #181726;
      color: #1f1d2d;
      font-size: clamp(0.86rem, 1.65vw, 1.04rem);
      line-height: 1.5;
      padding: 16px 12px 14px;
      cursor: pointer;
      transition: transform 0.12s steps(2), box-shadow 0.12s steps(2), background 0.12s steps(2);
    }
    .difficulty-btn:hover,
    .difficulty-btn:focus-visible {
      transform: translate(-2px, -2px);
      box-shadow: 7px 7px 0 #181726;
      background: #fffef4;
      outline: none;
    }

    .difficulty-btn small {
      display: block;
      margin-top: 8px;
      font-size: clamp(1rem, 2.1vw, 1.24rem);
      letter-spacing: 0.03em;
      color: #494663;
    }

    .reveal-title {
      font-size: clamp(0.68rem, 1.7vw, 0.82rem);
      line-height: 1.6;
      text-align: justify;
      text-align-last: left;
      color: #ece1c5;
    }

    .reveal-progress {
      text-align: justify;
      text-align-last: left;
      font-size: clamp(1.02rem, 2vw, 1.22rem);
      color: #111111;
      letter-spacing: 0.03em;
    }

    /* Force l'alignement du compteur global au centre sur tous les breakpoints. */
    #revealProgress {
      text-align: center;
      text-align-last: center;
    }

    .progress-points {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-items: center;
      gap: 8px;
      min-height: 18px;
      list-style: none;
      padding: 0;
      margin: 0;
      width: min(100%, 420px);
    }

    .progress-point {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      border: 2px solid rgba(255, 255, 255, 0.68);
      background: rgba(11, 15, 26, 0.85);
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22) inset;
      position: relative;
      transition: background 0.16s steps(4), border-color 0.16s steps(4), transform 0.16s steps(4);
    }

    .progress-point.is-correct {
      border-color: #1f4c22;
      background: #34d17a;
    }

    .progress-point.is-wrong {
      border-color: #5d2022;
      background: #ff4e55;
      cursor: pointer !important;
    }

    .progress-point.is-current {
      transform: scale(1.14);
      border-color: #f6f4e7;
      box-shadow: 0 0 0 2px rgba(255, 244, 231, 0.48);
    }

    .riddle-section {
      width: min(100%, 1000px);
      display: grid;
      gap: 8px;
      padding: 0 2px;
      justify-items: center;
      margin: 0 auto;
      font-family: Calibri, Arial, sans-serif;
      cursor: auto;
      text-align: justify;
      text-align-last: left;
      font-size: 22px;
    }

    /*
     * Zone énigme: question + réponse + validation visible en permanence
     * pour garder une UX mobile/desktop homogène.
     */
    .riddle-panel {
      border: 3px solid #1f1d2d;
      background: rgba(255, 249, 227, 0.97);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      padding: 9px 10px 10px;
      display: grid;
      gap: 7px;
      grid-template-rows: auto minmax(0, 1fr);
      min-height: 0;
      justify-items: center;
    }

    .riddle-panel-head {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .riddle-title {
      font-size: 22px;
      line-height: 1.45;
      text-transform: uppercase;
      color: #1f1d2d;
      letter-spacing: 0.04em;
      margin: 0;
      text-align: justify;
      text-align-last: left;
    }

    .riddle-question {
      margin: 0;
      display: grid;
      gap: 3px;
      align-content: start;
      align-items: start;
      grid-auto-rows: max-content;
      font-size: 22px;
      line-height: 1.2;
      color: #302e40;
      max-width: 72ch;
      width: 100%;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      overscroll-behavior-y: contain;
      touch-action: pan-y;
      text-align: justify;
      text-align-last: left;
    }

    .riddle-question img,
    .riddle-question video,
    .riddle-question iframe {
      margin-inline: auto;
    }

    .riddle-question-title {
      margin: 0;
      font-size: 22px;
      line-height: 1.3;
      color: #24213a;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      text-align: justify;
      text-align-last: left;
    }

    .riddle-block {
      margin: 0;
      font-size: inherit;
      line-height: inherit;
      color: inherit;
      max-width: 100%;
      min-width: 0;
    }

    .riddle-block img,
    .riddle-block video,
    .riddle-block iframe {
      width: auto;
      max-width: 100%;
      border: 3px solid #1f1d2d;
      background: #f8f4e2;
      box-shadow: 4px 4px 0 #181726;
      display: block;
      margin: 0 auto;
    }

    .riddle-block img,
    .riddle-block video {
      max-height: min(260px, 28vh);
      object-fit: contain;
    }

    .riddle-block.riddle-html img,
    .riddle-block.riddle-html video,
    .riddle-block.riddle-html iframe {
      margin: 0 auto;
      display: block;
      max-width: 100%;
      width: auto;
      height: auto;
    }

    .riddle-block iframe {
      aspect-ratio: 16 / 9;
      max-height: min(280px, 30vh);
      height: auto;
    }

    .riddle-block.riddle-html {
      min-height: 0;
    }

    .riddle-form {
      display: grid;
      gap: 8px;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: stretch;
      cursor: auto;
    }

    .riddle-form[hidden] {
      display: none !important;
    }

    .riddle-form button {
      white-space: nowrap;
      font-size: 22px;
    }

    .riddle-form input {
      width: 100%;
      border: 3px solid #1f1d2d;
      background: #fef8e5;
      font-size: 22px;
      font-family: Calibri, Arial, sans-serif;
      color: #1f1d2d;
      padding: 10px 10px 9px;
      line-height: 1.2;
      min-height: 42px;
      box-shadow: 4px 4px 0 #181726;
      outline: none;
      cursor: text;
      text-align: justify;
      text-align-last: left;
    }

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

    .riddle-form input:focus-visible {
      border-color: #1f2b3d;
      box-shadow: 6px 6px 0 #181726;
    }

    .riddle-form input::placeholder {
      color: #4e4f63;
      font-size: 22px;
    }

    .riddle-solved-prompt {
      width: 100%;
      border: 3px solid #1f1d2d;
      background: #fef8e5;
      color: #1f1d2d;
      font-size: 22px;
      font-family: Calibri, Arial, sans-serif;
      line-height: 1.2;
      min-height: 48px;
      padding: 10px 12px 9px;
      box-shadow: 4px 4px 0 #181726;
      display: grid;
      place-items: center;
      text-align: center;
      cursor: pointer;
    }

    .riddle-solved-prompt[hidden] {
      display: none !important;
    }

    .riddle-solved-prompt:focus-visible,
    .riddle-solved-prompt:hover {
      border-color: #1f2b3d;
      box-shadow: 6px 6px 0 #181726;
      outline: none;
    }

    .riddle-feedback {
      display: none;
      margin: 0;
      width: 100%;
      min-height: 0;
      border: 3px solid #1f1d2d;
      background: linear-gradient(180deg, #fff7e3 0%, #f2e5c0 100%);
      color: #2a2940;
      box-shadow: 4px 4px 0 #181726;
      padding: 9px 12px 8px;
      text-align: center;
      text-align-last: center;
      font-size: 22px;
      font-family: Calibri, Arial, sans-serif;
      font-weight: 700;
      line-height: 1.2;
      letter-spacing: 0.01em;
    }

    .riddle-feedback:not(:empty) {
      display: grid;
      place-items: center;
      min-height: 0;
    }

    .riddle-feedback.is-correct {
      border-color: #1f5a33;
      background: linear-gradient(180deg, #d9f6e5 0%, #b8e8cc 100%);
      color: #1b4d2b;
    }

    .riddle-feedback.is-wrong {
      border-color: #6b2328;
      background: linear-gradient(180deg, #ffe2e4 0%, #ffc8cd 100%);
      color: #7a1f2a;
    }

    .wrong-answers {
      border: 3px solid #1f1d2d;
      background: rgba(255, 249, 227, 0.88);
      padding: 10px 11px 11px;
      display: grid;
      gap: 10px;
      max-height: 205px;
      overflow: hidden;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .wrong-answers-title {
      margin: 0;
      font-size: clamp(0.74rem, 1.5vw, 0.86rem);
      line-height: 1.45;
      text-transform: uppercase;
      color: #1f1d2d;
      letter-spacing: 0.04em;
      text-align: justify;
      text-align-last: left;
    }

    .wrong-answer-list {
      list-style: none;
      margin: 0;
      padding: 0;
      display: grid;
      gap: 8px;
    }

    .wrong-answer-item {
      display: grid;
      gap: 6px;
      border-top: 1px solid rgba(31, 27, 44, 0.22);
      padding-top: 8px;
    }

    .wrong-answer-item:first-child {
      border-top: 0;
      padding-top: 0;
    }

    .wrong-answer-item p {
      margin: 0;
      color: #413f57;
      font-size: clamp(0.9rem, 1.55vw, 1.03rem);
      line-height: 1.3;
      word-break: break-word;
      text-align: justify;
      text-align-last: left;
    }

    .wrong-answer-item .retry-btn {
      justify-self: start;
      max-width: fit-content;
    }

    .action-btn.tiny-btn {
      font-size: clamp(0.52rem, 1.22vw, 0.64rem);
      padding: 9px 10px 8px;
      min-height: 40px;
    }

    .pixel-frame {
      padding: 0;
      border: 0;
      box-shadow: none;
      background: transparent;
      width: 100%;
      height: 100%;
      overflow: hidden;
      align-self: center;
    }

    .pixel-portrait {
      display: block;
      width: 100%;
      height: 100%;
      aspect-ratio: 1 / 1;
      image-rendering: auto;
      background: transparent;
    }

    .reveal-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 10px;
    }

    .clues-panel {
      height: var(--portrait-size, 320px);
      display: grid;
      grid-template-rows: repeat(3, minmax(0, 1fr));
      gap: 10px;
      align-self: center;
      width: 100%;
      min-width: 230px;
      max-width: 320px;
    }

    .clue-card {
      border: 3px solid #1f1d2d;
      background: rgba(255, 249, 227, 0.88);
      padding: 10px 12px;
      display: grid;
      align-content: start;
      gap: 6px;
      transition: opacity 0.14s steps(4), filter 0.14s steps(4), transform 0.14s steps(4);
    }

    .clue-card h3 {
      font-size: clamp(0.55rem, 1.2vw, 0.65rem);
      line-height: 1.5;
      color: #1f1d2d;
    }

    .clue-text {
      font-size: clamp(1rem, 1.7vw, 1.14rem);
      color: #433f59;
      line-height: 1.25;
    }

    .clue-card.is-locked {
      opacity: 0.62;
      filter: grayscale(0.3);
    }

    .clue-card.is-locked .clue-text {
      color: #656179;
    }

    .action-btn {
      border: 3px solid #1f1d2d;
      background: #fef8e5;
      box-shadow: 4px 4px 0 #181726;
      color: #1f1d2d;
      font-size: clamp(0.78rem, 1.45vw, 1rem);
      line-height: 1.5;
      padding: 12px 14px 10px;
      cursor: pointer;
      transition: transform 0.12s steps(2), box-shadow 0.12s steps(2), opacity 0.12s steps(2);
    }

    .action-btn:hover,
    .action-btn:focus-visible {
      transform: translate(-2px, -2px);
      box-shadow: 7px 7px 0 #181726;
      outline: none;
    }

    .action-btn.secondary {
      background: #f0ecd8;
    }

    .action-btn:disabled {
      cursor: not-allowed;
      opacity: 0.45;
      transform: none;
      box-shadow: 2px 2px 0 #181726;
    }

    .reveal-hint {
      text-align: justify;
      text-align-last: left;
      font-size: clamp(1.05rem, 2vw, 1.23rem);
      color: #cdbd9e;
      max-width: 680px;
    }

    .reveal-view.is-riddle-hidden .riddle-panel {
      display: none;
    }

    .reveal-view.is-riddle-hidden .riddle-form {
      grid-template-columns: minmax(0, 1fr) auto;
    }

    /*
     * ===== REVEAL - MODE "PORTRAIT CENTRAL" (OVERRIDE =====
     * Tous les contrôles d'énigmes restent actifs mais encadrés dans la zone portrait.
     */
    .reveal-view.is-ready .reveal-core {
      position: relative;
      width: min(96vw, var(--reveal-frame-size));
      max-width: min(96vw, 100%);
      margin: 0 auto;
      display: block;
      justify-items: center;
      align-content: start;
    }

    .reveal-progress-wrap {
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      width: min(88%, 520px);
      display: grid;
      gap: 8px;
      justify-items: center;
      z-index: 11;
      margin: 0;
      padding: 8px 10px;
      border: 3px solid #1f1d2d;
      background: rgba(14, 15, 22, 0.68);
      box-shadow: 2px 3px 0 #181726;
      pointer-events: none;
    }

    .reveal-progress-wrap .reveal-progress {
      text-align: justify;
      text-align-last: left;
      color: #111111;
      font-size: clamp(0.86rem, 1.7vw, 1rem);
      letter-spacing: 0.02em;
      margin: 0;
      max-width: 100%;
      text-wrap: balance;
    }

    .progress-points {
      width: min(100%, 520px);
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      margin: 0;
      padding: 0;
      min-height: 18px;
      list-style: none;
    }

    .progress-point {
      appearance: none;
      width: 20px;
      height: 20px;
      border: 2px solid rgba(255, 255, 255, 0.68);
      border-radius: 50%;
      background: rgba(11, 15, 26, 0.85);
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22) inset;
      position: relative;
      transition: background 0.16s steps(4), border-color 0.16s steps(4), transform 0.16s steps(4);
      display: inline-grid;
      place-items: center;
      cursor: pointer;
      color: transparent;
      padding: 0;
      margin: 0;
      min-width: 0;
      min-height: 0;
    }

    .progress-point:focus-visible {
      outline: 3px solid #f6f4e7;
      outline-offset: 2px;
    }

    .progress-point.is-correct {
      border-color: #1f4c22;
      background: #34d17a;
    }

    .progress-point.is-wrong {
      border-color: #5d2022;
      background: #ff4e55;
      animation: revealWrongPulse 1.2s ease-in-out infinite;
    }

    .progress-point.is-current {
      transform: scale(1.14);
      border-color: #f6f4e7;
      box-shadow: 0 0 0 2px rgba(255, 244, 231, 0.48);
    }

    .progress-point::after {
      content: '?';
      display: none;
      position: absolute;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      color: #ffd84d;
      background: #0f2f4f;
      border: 1px solid rgba(255, 255, 255, 0.72);
      font-size: 20px;
      line-height: 28px;
      text-align: center;
      inset: auto;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      pointer-events: none;
    }

    .progress-point.is-unlocked-clue::after {
      display: block;
      box-shadow: 0 0 0 1px rgba(255, 244, 231, 0.56) inset;
      background: #0f2f4f;
      border-color: rgba(255, 255, 255, 0.88);
      animation: clueHaloPulse 1.15s ease-in-out infinite;
      box-shadow:
        0 0 0 1px rgba(255, 244, 231, 0.56) inset,
        0 0 6px rgba(76, 255, 138, 0.72),
        0 0 14px rgba(76, 255, 138, 0.58);
    }

    .progress-point.is-wrong {
      position: relative;
      box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.22) inset,
        0 0 0 2px rgba(255, 72, 76, 0.35);
    }

    .reveal-frame-wrap {
      position: relative;
      width: min(100%, 1000px);
      aspect-ratio: 1 / 1;
      margin: 0 auto;
      display: block;
      isolation: isolate;
      max-width: none;
    }

    .reveal-content {
      width: 100%;
      height: 100%;
      aspect-ratio: 1 / 1;
      aspect-ratio: 1 / 1;
      border: 3px solid #1f1d2d;
      background: rgba(0, 0, 0, 0.06);
      box-shadow: 6px 8px 0 #16152a;
      display: grid;
      place-items: stretch;
      justify-items: center;
      padding: 0;
      overflow: hidden;
      position: relative;
    }

    .reveal-nav {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      z-index: 8;
      width: clamp(42px, 5vw, 56px);
      height: clamp(72px, 12vh, 88px);
      border: 3px solid #1f1d2d;
      background: #fef8e5;
      box-shadow: 2px 4px 0 #181726;
      font-size: clamp(1.1rem, 2.4vw, 1.5rem);
      color: #1f1d2d;
      display: grid;
      place-items: center;
      cursor: pointer;
      transition: transform 0.12s steps(2), box-shadow 0.12s steps(2);
      line-height: 1;
      min-height: 0;
      min-width: 0;
      user-select: none;
      padding: 0;
    }

    .reveal-nav-left {
      left: 0;
      border-right-width: 2px;
    }

    .reveal-nav-right {
      right: 0;
      border-left-width: 2px;
    }

    .reveal-nav:hover,
    .reveal-nav:focus-visible {
      transform: translateY(-50%) translateX(-2px);
      box-shadow: 4px 6px 0 #181726;
    }

    .riddle-section {
      width: min(100%, 1000px);
      max-width: 100%;
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      bottom: 8px;
      z-index: 9;
      display: grid;
      gap: 8px;
      padding: 0;
      justify-items: stretch;
      font-family: Calibri, Arial, sans-serif;
      cursor: auto;
      pointer-events: auto;
      text-align: justify;
      text-align-last: left;
      font-size: 22px;
      justify-items: center;
    }

.reveal-view.is-riddle-mode .riddle-section {
  top: clamp(67px, 8.1vh, 86px);
  left: clamp(58px, 8.1vw, 92px);
  right: clamp(58px, 8.1vw, 92px);
  bottom: clamp(79px, 14.4vh, 112px);
  margin-top: 8px;
  min-width: min(600px, calc(100% - 24px));
      width: auto;
      height: auto;
      max-width: none;
      max-height: none;
      display: grid;
      grid-template-rows: minmax(0, 1fr) auto auto;
      gap: clamp(6px, 1.4vw, 8px);
      padding: clamp(6px, 1.8vw, 10px);
      background: transparent !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      border: 0;
      box-shadow: none;
      z-index: 10;
      overflow: hidden;
      transform: none;
    }

    .reveal-view.is-riddle-mode .riddle-panel,
    .reveal-view.is-riddle-mode .riddle-form,
    .reveal-view.is-riddle-mode .riddle-feedback {
      width: 100%;
      margin: 0 auto;
      max-width: none;
      box-sizing: border-box;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    .reveal-view.is-riddle-mode .riddle-panel {
      flex: 1 1 auto;
      display: grid;
      gap: clamp(6px, 1.3vw, 8px);
      grid-template-rows: auto minmax(0, 1fr);
      align-content: stretch;
      overflow: hidden;
      min-height: 0;
      max-height: none;
      min-width: 0;
      border: 0;
      box-shadow: none;
      background: transparent !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }

    .reveal-view.is-riddle-mode .riddle-panel::-webkit-scrollbar,
    .reveal-view.is-riddle-mode .wrong-answers::-webkit-scrollbar,
    .reveal-view.is-riddle-mode .game-area::-webkit-scrollbar,
    .reveal-view.is-riddle-mode .stage-view::-webkit-scrollbar,
    .game-area::-webkit-scrollbar,
    .stage-view::-webkit-scrollbar {
      width: 0;
      height: 0;
      background: transparent;
    }

    .reveal-view.is-riddle-mode .riddle-question {
      font-size: 22px;
      line-height: 1.2;
      align-content: start;
      align-items: start;
      grid-auto-rows: max-content;
      max-width: none;
      text-wrap: balance;
      text-align: justify;
      text-align-last: left;
    }

    .reveal-view.is-riddle-mode .riddle-form {
      margin: 0;
      flex: 0 0 auto;
      width: 100%;
      gap: clamp(6px, 1.4vw, 9px);
      align-self: end;
    }

    .reveal-view.is-riddle-mode .riddle-feedback {
      max-height: none;
      overflow: visible;
    }

    .reveal-view.is-portrait-mode .riddle-section {
      top: clamp(64px, 10vh, 92px);
      left: clamp(56px, 8vw, 88px);
      right: clamp(56px, 8vw, 88px);
      bottom: clamp(84px, 13vh, 112px);
      width: auto;
      height: auto;
      max-width: none;
      max-height: none;
      display: grid;
      grid-template-rows: auto;
      gap: 8px;
      padding: clamp(8px, 2vw, 12px);
      background: transparent;
      z-index: 12;
      overflow: visible;
      transform: none;
    }

    .reveal-view.is-portrait-mode .riddle-panel {
      display: none;
    }

    .reveal-view.is-portrait-mode .riddle-form {
      width: 100%;
      margin: 0 auto;
      max-width: none;
      box-sizing: border-box;
      gap: 8px;
      min-width: 0;
      grid-template-columns: minmax(0, 1fr) auto;
      align-self: end;
    }

    .reveal-view.is-riddle-mode .reveal-progress-wrap,
    .reveal-view.is-riddle-mode .reveal-nav-left,
    .reveal-view.is-riddle-mode .reveal-nav-right {
      z-index: 18;
    }

    .riddle-panel {
      border: 3px solid #1f1d2d;
      background: rgba(255, 249, 227, 0.97);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      padding: 10px 11px 11px;
      display: grid;
      gap: 8px;
      width: 100%;
      min-height: 0;
      opacity: 1;
      justify-items: center;
    }

    .riddle-panel-head {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .riddle-title {
      font-size: 22px;
      line-height: 1.45;
      text-transform: uppercase;
      color: #1f1d2d;
      letter-spacing: 0.04em;
      margin: 0;
      text-align: justify;
      text-align-last: left;
    }

    .riddle-question {
      margin: 0;
      display: grid;
      gap: 3px;
      align-content: start;
      align-items: start;
      grid-auto-rows: max-content;
      font-size: 22px;
      line-height: 1.2;
      color: #302e40;
      max-width: 72ch;
      width: 100%;
      min-height: 0;
      overflow: hidden;
      text-align: justify;
      text-align-last: left;
    }

    .riddle-question img,
    .riddle-question video,
    .riddle-question iframe {
      margin-inline: auto;
    }

    .riddle-question-title {
      margin: 0;
      font-size: 22px;
      line-height: 1.35;
      color: #24213a;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      text-align: justify;
      text-align-last: left;
    }

    .riddle-block {
      margin: 0;
      font-size: inherit;
      line-height: inherit;
      color: inherit;
      max-width: 100%;
      min-width: 0;
    }

    .riddle-block img,
    .riddle-block video,
    .riddle-block iframe {
      width: auto;
      max-width: 100%;
      border: 3px solid #1f1d2d;
      background: #f8f4e2;
      box-shadow: 4px 4px 0 #181726;
      display: block;
      margin: 0 auto;
    }

    .riddle-block img,
    .riddle-block video {
      max-height: min(240px, 26vh);
      object-fit: contain;
    }

    .riddle-block.riddle-html img,
    .riddle-block.riddle-html video,
    .riddle-block.riddle-html iframe {
      margin: 0 auto;
      display: block;
      max-width: 100%;
      width: auto;
      height: auto;
    }

    .riddle-block iframe {
      aspect-ratio: 16 / 9;
      max-height: min(260px, 28vh);
      height: auto;
    }

    .riddle-form {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: stretch;
      width: 100%;
      cursor: auto;
    }

    .riddle-form button {
      white-space: nowrap;
      font-size: 22px;
    }

    .riddle-form input {
      width: 100%;
      border: 3px solid #1f1d2d;
      background: #fef8e5;
      font-size: 22px;
      font-family: Calibri, Arial, sans-serif;
      color: #1f1d2d;
      padding: 10px 10px 9px;
      line-height: 1.2;
      min-height: 42px;
      box-shadow: 4px 4px 0 #181726;
      outline: none;
      cursor: text;
      text-align: justify;
      text-align-last: left;
    }

    .riddle-form button,
    .riddle-form input {
      min-height: 48px;
    }

    .riddle-form input:focus-visible {
      border-color: #1f2b3d;
      box-shadow: 6px 6px 0 #181726;
    }

    .riddle-form input::placeholder {
      color: #4e4f63;
      font-size: 22px;
    }

    .riddle-feedback {
      display: none;
      margin: 0;
      width: 100%;
      min-height: 0;
      border: 3px solid #1f1d2d;
      background: linear-gradient(180deg, #fff7e3 0%, #f2e5c0 100%);
      color: #2a2940;
      box-shadow: 4px 4px 0 #181726;
      padding: 9px 12px 8px;
      text-align: center;
      text-align-last: center;
      font-size: 22px;
      font-family: Calibri, Arial, sans-serif;
      font-weight: 700;
      line-height: 1.2;
      letter-spacing: 0.01em;
    }

    .riddle-feedback:not(:empty) {
      display: grid;
      place-items: center;
      min-height: 0;
    }

    .riddle-feedback.is-correct {
      border-color: #1f5a33;
      background: linear-gradient(180deg, #d9f6e5 0%, #b8e8cc 100%);
      color: #1b4d2b;
    }

    .riddle-feedback.is-wrong {
      border-color: #6b2328;
      background: linear-gradient(180deg, #ffe2e4 0%, #ffc8cd 100%);
      color: #7a1f2a;
    }

    .reveal-view.is-portrait-mode .riddle-feedback:not(:empty) {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      align-self: start;
      min-height: 0;
      height: auto;
      width: fit-content;
      max-width: min(100%, 620px);
      justify-self: center;
      margin: 0 auto;
    }

    .wrong-answers {
      display: none !important;
    }

    .pixel-frame {
      padding: 0;
      border: 0;
      box-shadow: none;
      background: transparent;
      width: 100%;
      height: 100%;
      overflow: hidden;
      align-self: stretch;
      display: grid;
      place-items: center;
    }

    .pixel-portrait {
      width: 100%;
      height: 100%;
      aspect-ratio: 1 / 1;
    }

    .reveal-actions {
      width: calc(100% - 24px);
      position: relative;
      top: auto;
      left: auto;
      right: auto;
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      pointer-events: none;
      z-index: 8;
    }

    .reveal-actions .action-btn {
      pointer-events: auto;
    }

    #togglePortraitBtn {
      margin: 0;
      width: auto;
      min-width: min(180px, 34vw);
      z-index: 15;
      position: relative;
    }

    .reveal-view.is-riddle-mode #togglePortraitBtn {
      position: relative;
      top: auto;
      right: auto;
      margin: 0;
      z-index: auto;
      width: auto;
    }

    .clues-panel {
      display: none !important;
    }

    .clue-card {
      display: none !important;
    }

    .reveal-hint {
      display: none !important;
    }

    .reveal-clue-modal {
      position: fixed;
      inset: 0;
      background: rgba(4, 8, 16, 0.58);
      display: none;
      place-items: center;
      z-index: 100;
      padding: 20px;
    }

    .selection-login-modal {
      position: fixed;
      inset: 0;
      background: rgba(4, 8, 16, 0.58);
      display: none;
      place-items: center;
      z-index: 120;
      padding: 20px;
    }

    .selection-login-modal.is-open {
      display: grid;
    }

    .selection-login-backdrop {
      position: absolute;
      inset: 0;
      cursor: pointer;
    }

    .selection-login-card {
      position: relative;
      z-index: 1;
      width: min(94vw, 560px);
      background: rgba(255, 249, 227, 0.98);
      border: 3px solid #1f1d2d;
      box-shadow: 10px 10px 0 #181726;
      padding: 14px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-areas:
        "title close"
        "form form";
      column-gap: 12px;
      row-gap: 10px;
    }

    .selection-login-card h3 {
      grid-area: title;
      margin: 0;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      color: #1f1d2d;
      font-size: 22px;
      font-family: Calibri, Arial, sans-serif;
      align-self: center;
    }

    #selectionLoginClose {
      grid-area: close;
      justify-self: end;
      align-self: center;
    }

    .selection-login-form {
      grid-area: form;
      display: grid;
      gap: 8px;
      font-family: Calibri, Arial, sans-serif;
    }

    .selection-login-form label {
      color: #2c2a3c;
      font-size: 20px;
      line-height: 1.2;
    }

    .selection-login-form input {
      width: 100%;
      border: 3px solid #1f1d2d;
      background: #fef8e5;
      color: #1f1d2d;
      font-size: 20px;
      font-family: Calibri, Arial, sans-serif;
      padding: 10px 10px 9px;
      min-height: 44px;
      box-shadow: 4px 4px 0 #181726;
      outline: none;
    }

    .selection-login-form input:focus-visible {
      border-color: #1f2b3d;
      box-shadow: 6px 6px 0 #181726;
    }

    .selection-login-feedback {
      margin: 0;
      min-height: 1.1rem;
      font-size: 18px;
      color: #1f1d2d;
      font-family: Calibri, Arial, sans-serif;
    }

    .selection-login-feedback.error {
      color: #b31f29;
    }

    .selection-login-feedback.ok {
      color: #1e7f45;
    }

    .classmate-modal-card {
      width: min(94vw, 640px);
      grid-template-areas:
        "title close"
        "form form"
        "list list"
        "feedback feedback";
    }

    #classmateModalValidate {
      grid-area: close;
      justify-self: end;
      align-self: center;
    }

    #classmateModalTitle {
      grid-area: title;
      margin: 0;
      align-self: center;
    }

    .classmate-modal-form {
      grid-area: form;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }

    .classmate-modal-form input {
      width: 100%;
      border: 3px solid #1f1d2d;
      background: #fef8e5;
      color: #1f1d2d;
      font-size: 20px;
      font-family: Calibri, Arial, sans-serif;
      padding: 10px 10px 9px;
      min-height: 44px;
      box-shadow: 4px 4px 0 #181726;
      outline: none;
    }

    .classmate-modal-form input:focus-visible {
      border-color: #1f2b3d;
      box-shadow: 6px 6px 0 #181726;
    }

    .classmate-modal-list {
      grid-area: list;
      list-style: none;
      margin: 0;
      padding: 0;
      display: grid;
      gap: 7px;
      max-height: min(42vh, 360px);
      overflow-y: auto;
      font-family: Calibri, Arial, sans-serif;
    }

    .classmate-modal-list-item {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #1f1d2d;
      font-size: 19px;
      line-height: 1.2;
    }

    .classmate-remove-btn {
      width: 28px;
      height: 28px;
      border: 1px solid #1f1d2d;
      background: #fef8e5;
      color: #1f1d2d;
      box-shadow: 1px 1px 0 #181726;
      border-radius: 7px;
      font: 700 20px/1 Calibri, Arial, sans-serif;
      padding: 0;
      cursor: pointer;
      flex: 0 0 auto;
    }

    .classmate-modal-feedback {
      grid-area: feedback;
      margin: 0;
    }

    .reveal-clue-modal.is-open {
      display: grid;
    }

    .reveal-clue-backdrop {
      position: absolute;
      inset: 0;
      cursor: pointer;
    }

    .reveal-clue-card {
      position: relative;
      z-index: 1;
      width: min(94vw, 560px);
      background: rgba(255, 249, 227, 0.96);
      border: 3px solid #1f1d2d;
      box-shadow: 10px 10px 0 #181726;
      padding: 14px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-areas:
        "title close"
        "text text";
      column-gap: 12px;
      row-gap: 10px;
      justify-items: start;
    }

    .reveal-clue-card h3 {
      grid-area: title;
      color: #1f1d2d;
      line-height: 1.25;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      margin: 0;
      align-self: center;
      font-family: Calibri, Arial, sans-serif;
    }

    .reveal-clue-text {
      grid-area: text;
      margin: 0;
      color: #332f45;
      font-size: clamp(1rem, 2.1vw, 1.16rem);
      line-height: 1.4;
      text-align: justify;
      text-align-last: left;
      font-family: Calibri, Arial, sans-serif;
    }

    .reveal-view .riddle-section,
    .reveal-view .riddle-question,
    .reveal-view .riddle-question-title,
    .reveal-view .riddle-title,
    .reveal-view .riddle-block,
    .reveal-view .riddle-form,
    .reveal-view .riddle-form button,
    .reveal-view .riddle-form input,
    .reveal-view .riddle-feedback,
    .reveal-view .wrong-answer-item,
    .reveal-view .wrong-answers-title,
    .reveal-view .wrong-answer-item p {
      font-size: 22px !important;
      font-family: Calibri, Arial, sans-serif !important;
      text-align: justify !important;
      text-align-last: left !important;
    }

    #revealClueClose {
      grid-area: close;
      justify-self: end;
      align-self: center;
    }

    @media (min-width: 761px) {
      .reveal-view.is-ready .reveal-core,
      .reveal-frame-wrap {
        min-width: 600px;
      }

      .reveal-topbar {
        left: 50%;
        right: auto;
        width: min(calc(100% - 24px), 980px);
        min-width: 600px;
        transform: translateX(-50%);
      }
    }

    @media (min-width: 1024px) {
      .reveal-clue-card h3,
      .reveal-clue-text {
        font-family: Calibri, Arial, sans-serif;
        font-size: 32px;
        line-height: 1.2;
      }
    }

    @keyframes revealWrongPulse {
      0%,
      100% {
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22) inset;
      }

      50% {
        box-shadow: 0 0 0 2px rgba(255, 85, 88, 0.45), 0 0 0 6px rgba(255, 85, 88, 0.25);
      }
    }

    @keyframes clueHaloPulse {
      0%,
      100% {
        box-shadow:
          0 0 0 1px rgba(255, 244, 231, 0.56) inset,
          0 0 4px rgba(76, 255, 138, 0.62),
          0 0 10px rgba(76, 255, 138, 0.46);
      }

      50% {
        box-shadow:
          0 0 0 1px rgba(255, 244, 231, 0.7) inset,
          0 0 9px rgba(76, 255, 138, 0.92),
          0 0 22px rgba(76, 255, 138, 0.74);
      }
    }

    /*
     * ===== TRANSITION VISUELLE ENTRE VUES =====
     */
    .curtain {
      position: fixed;
      inset: 0;
      z-index: 80;
      pointer-events: none;
      overflow: hidden;
    }

    .curtain-panel {
      position: absolute;
      top: 0;
      width: 52%;
      height: 100%;
      background: repeating-linear-gradient(90deg, #151323 0, #151323 8px, #26233a 8px, #26233a 15px, #0c0b14 15px, #0c0b14 18px);
      box-shadow: inset 0 0 0 3px #090812, inset 0 0 36px rgba(0, 0, 0, 0.45);
      transition: transform 0.34s steps(12);
    }

    .curtain-left {
      left: 0;
      transform: translateX(-103%);
    }

    .curtain-right {
      right: 0;
      transform: translateX(103%);
    }

    body.curtain-closed .curtain-left {
      transform: translateX(0);
    }

    body.curtain-closed .curtain-right {
      transform: translateX(0);
    }

    body.is-switching .container {
      pointer-events: none;
    }

    /*
     * ===== THEME PAR PERSONNAGE =====
     * Corps global modifié selon la carte active (survol/focus).
     */
    body.einstein-active {
      color: #ebebeb;
      background: radial-gradient(circle at 18% 24%, #585858 0%, #2f2f2f 36%, #171717 70%, #040404 100%);
    }

    body.einstein-active::before {
      opacity: 0;
    }

    body.einstein-active .warp-canvas {
      opacity: 1;
    }

    body.einstein-active .game-title {
      color: #4fb0ff;
      text-shadow:
        0 2px 0 #0f2942,
        0 4px 0 #0a1b2c,
        0 8px 16px rgba(0, 0, 0, 0.5),
        0 0 14px rgba(91, 175, 255, 0.55);
    }

    body.einstein-active .hint {
      color: #cfcfcf;
      letter-spacing: 0.05em;
    }

    body.einstein-active .floating-hole {
      opacity: 1;
      left: auto;
      right: 50px;
      transform: translate(0, -50%) scale(1);
    }

    body.einstein-active .einstein-card {
      border-color: #d8d8d8;
      box-shadow:
        0 16px 30px rgba(5, 5, 5, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    }

    body.curie-active {
      color: #d7dfcf;
      background:
        radial-gradient(84vmax 68vmax at 88% 88%, rgba(81, 138, 54, 0.22) 0%, rgba(42, 82, 33, 0.2) 18%, rgba(18, 30, 18, 0.9) 39%, #070907 66%, #030303 100%);
    }

    body.curie-active::before {
      inset: 0;
      transform: none;
      filter: none;
      opacity: 0.08;
      background-image:
        linear-gradient(rgba(138, 195, 117, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(138, 195, 117, 0.06) 1px, transparent 1px);
      background-size: 11px 11px;
    }

    body.curie-active::after {
      opacity: 1;
      background:
        radial-gradient(58vmax 48vmax at 100% 100%, rgba(155, 234, 120, 0.2) 0%, rgba(97, 171, 73, 0.15) 20%, rgba(52, 94, 43, 0.08) 34%, rgba(0, 0, 0, 0) 56%),
        radial-gradient(30vmax 24vmax at 100% 100%, rgba(186, 255, 150, 0.1) 0%, rgba(88, 156, 66, 0.07) 28%, rgba(0, 0, 0, 0) 62%);
    }

    body.curie-active .game-title {
      color: #4fb0ff;
      text-shadow:
        0 2px 0 #0f2942,
        0 4px 0 #0a1b2c,
        0 8px 16px rgba(0, 0, 0, 0.5),
        0 0 14px rgba(91, 175, 255, 0.55);
    }

    body.curie-active .hint {
      color: #c3d3b2;
    }

    body.curie-active .radiation-noise-canvas {
      opacity: 0.61;
    }

    body.view-reveal.curie-active .radiation-noise-canvas {
      z-index: 0;
    }

    body.curie-active .curie-crystal {
      opacity: 1;
      transform: scale(1);
    }

    body.curie-active .curie-crystal::after {
      animation: curiePhosphorPulse 10.5s ease-in-out infinite;
    }

    body.lamarr-active {
      color: #d6deef;
      background:
        radial-gradient(120vmax 86vmax at 52% -24%, #1f3f78 0%, #152f5e 24%, #0f254a 45%, #0b1b39 66%, #09132b 100%);
    }

    body.lamarr-active::before {
      opacity: 0;
    }

    body.lamarr-active .lamarr-ripple-canvas {
      opacity: 1;
    }

    body.lamarr-active .game-title {
      color: #4fb0ff;
      text-shadow:
        0 2px 0 #0f2942,
        0 4px 0 #0a1b2c,
        0 8px 16px rgba(0, 0, 0, 0.5),
        0 0 14px rgba(91, 175, 255, 0.55);
    }

    body.lamarr-active .hint {
      color: #ccd9f2;
    }

    body.lamarr-active .lamarr-card {
      border-color: #d9e6ff;
      box-shadow:
        0 16px 30px rgba(10, 24, 55, 0.4),
        inset 0 1px 0 rgba(235, 243, 255, 0.24);
    }

    body.monka-active {
      color: #d3ffe2;
      background: #050d09;
    }

    body.monka-active::before {
      inset: 0;
      transform: none;
      background-image:
        radial-gradient(120vmax 90vmax at 50% -20%, rgba(48, 120, 78, 0.19) 0%, rgba(18, 36, 24, 0.36) 42%, rgba(4, 10, 7, 0.82) 100%),
        linear-gradient(180deg, rgba(6, 14, 11, 0.84) 0%, rgba(5, 12, 10, 0.58) 40%, rgba(2, 7, 5, 0.88) 100%),
        url("../assets/images/classe.png");
      background-position: center center, 0 0, center calc(50% + 100px);
      background-size: 100% 100%, 100% 100%, cover;
      background-repeat: no-repeat, no-repeat, no-repeat;
      background-blend-mode: screen, multiply, normal;
      filter: saturate(0.9) contrast(1.06);
      opacity: 1;
    }

    body.monka-active .monka-matrix-canvas {
      opacity: 0.96;
    }

    body.monka-active .game-title {
      color: #4fb0ff;
      text-shadow:
        0 2px 0 #0f2942,
        0 4px 0 #0a1b2c,
        0 8px 16px rgba(0, 0, 0, 0.56),
        0 0 16px rgba(94, 178, 255, 0.6);
    }

    body.monka-active .hint {
      color: #c9ffd7;
    }

    body.calcea-active {
      color: #eef6ff;
      background: #07101f;
    }

    body.calcea-active::before {
      opacity: 1;
      background-image:
        radial-gradient(52vmax 28vmax at 18% 16%, rgba(132, 216, 255, 0.16) 0%, rgba(132, 216, 255, 0.05) 28%, rgba(132, 216, 255, 0) 62%),
        radial-gradient(44vmax 24vmax at 82% 18%, rgba(59, 122, 255, 0.16) 0%, rgba(59, 122, 255, 0.05) 32%, rgba(59, 122, 255, 0) 66%),
        linear-gradient(180deg, rgba(4, 10, 24, 0.72) 0%, rgba(5, 12, 26, 0.54) 36%, rgba(4, 9, 21, 0.82) 100%);
      background-position: center center, center center, center center;
      background-size: 100% 100%, 100% 100%, 100% 100%;
      background-repeat: no-repeat, no-repeat, no-repeat;
      background-blend-mode: screen, screen, multiply;
      filter: saturate(1.06) contrast(1.08);
    }

    body.calcea-active .calcea-geometry {
      opacity: 1;
    }

    body.calcea-active .calcea-art {
      opacity: 1;
    }

    body.calcea-active .game-title {
      color: #4fb0ff;
      text-shadow:
        0 2px 0 #0f2942,
        0 4px 0 #0a1b2c,
        0 8px 16px rgba(0, 0, 0, 0.5),
        0 0 14px rgba(91, 175, 255, 0.55);
    }

    body.calcea-active .hint {
      color: #eef7ff;
    }

    body.calcea-active .calcea-card {
      border-color: rgba(255, 218, 104, 0.92);
      box-shadow:
        0 16px 30px rgba(8, 22, 61, 0.3),
        inset 0 1px 0 rgba(255, 244, 198, 0.3);
    }

    @keyframes calceaTriangleTrace {
      0%, 8% {
        stroke-dashoffset: 100;
        opacity: 0;
      }
      10% {
        opacity: 0.96;
      }
      52% {
        stroke-dashoffset: 0;
        opacity: 0.96;
      }
      58% {
        opacity: 0.96;
      }
      62% {
        opacity: 0;
      }
      66% {
        opacity: 0.96;
      }
      70% {
        opacity: 0;
      }
      74% {
        opacity: 0.96;
      }
      78%, 100% {
        opacity: 0;
        stroke-dashoffset: 0;
      }
    }

    @keyframes calceaTriangleSquare {
      0%, 50% {
        opacity: 0;
        transform: scale(0.72);
      }
      54%, 58% {
        opacity: 0.98;
        transform: scale(1);
      }
      62% {
        opacity: 0;
        transform: scale(0.96);
      }
      66% {
        opacity: 0.98;
        transform: scale(1);
      }
      70% {
        opacity: 0;
        transform: scale(0.96);
      }
      74% {
        opacity: 0.98;
        transform: scale(1);
      }
      78%, 100% {
        opacity: 0;
        transform: scale(0.88);
      }
    }

    @keyframes curiePhosphorPulse {
      0%, 100% {
        opacity: 0.56;
        filter: blur(5.2px);
      }
      50% {
        opacity: 0.62;
        filter: blur(5.9px);
      }
    }

    @media (max-width: 760px) {
      html,
      body {
        width: 100%;
        min-width: 600px;
        height: auto;
        max-height: none;
        min-height: 100dvh;
      }

      body::before {
        background-position: 0 0, 50% 50%;
        background-size: 100% 100%, cover;
        filter: saturate(1.02) contrast(1.02);
      }

      body {
        padding: 20px 12px 36px;
        overflow-y: auto;
        overflow-x: auto;
        overscroll-behavior-y: auto;
      }

      .container {
        width: max(100%, 600px);
        min-width: 600px;
        height: auto;
        min-height: calc(100dvh - 56px);
      }

      .hero,
      .game-area,
      .stage-view,
      .difficulty-view,
      .portraits {
        min-width: 600px;
      }

      .game-area,
      .stage-view,
      .reveal-view {
        overflow-y: auto;
        overflow-x: hidden;
        touch-action: pan-y;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: auto;
        -ms-overflow-style: auto;
      }

      .game-area,
      .stage-view {
        height: auto;
        max-height: none;
      }

      .game-area::-webkit-scrollbar,
      .stage-view::-webkit-scrollbar,
      .reveal-view::-webkit-scrollbar,
      .reveal-view.is-riddle-mode .riddle-panel::-webkit-scrollbar,
      .reveal-view.is-riddle-mode .wrong-answers::-webkit-scrollbar {
        width: 8px;
        height: 8px;
        background: transparent;
      }

      .game-area::-webkit-scrollbar-thumb,
      .stage-view::-webkit-scrollbar-thumb,
      .reveal-view::-webkit-scrollbar-thumb,
      .reveal-view.is-riddle-mode .riddle-panel::-webkit-scrollbar-thumb,
      .reveal-view.is-riddle-mode .wrong-answers::-webkit-scrollbar-thumb {
        background: rgba(248, 236, 197, 0.72);
        border-radius: 8px;
      }

      .game-area::-webkit-scrollbar-track,
      .stage-view::-webkit-scrollbar-track,
      .reveal-view::-webkit-scrollbar-track,
      .reveal-view.is-riddle-mode .riddle-panel::-webkit-scrollbar-track,
      .reveal-view.is-riddle-mode .wrong-answers::-webkit-scrollbar-track {
        background: rgba(20, 18, 38, 0.3);
      }

      .hero {
        padding-top: clamp(4px, 1.2vh, 10px);
      }

      .selection-auth-zone {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        margin: 0 4px 6px auto;
        width: fit-content;
      }

      .selection-auth-btn {
        font-size: clamp(1.06rem, 4.2vw, 1.2rem);
        min-height: 44px;
        padding: 8px 14px;
      }

      .portraits {
        grid-template-columns: repeat(2, auto);
        justify-content: center;
        width: fit-content;
        max-width: 100%;
        margin-inline: auto;
        gap: 8px;
      }

      .portraits > .portrait,
      .portraits > .portrait:nth-child(4),
      .portraits > .portrait:nth-child(5),
      .portraits > .portrait:nth-child(6) {
        grid-column: auto;
      }

      .game-title {
        margin-top: 0;
        font-size: clamp(1.56rem, 8vw, 2.3rem);
        letter-spacing: 0.04em;
      }

      .floating-hole {
        width: clamp(170px, 38vw, 320px);
      }

      .calcea-art {
        right: 0;
        bottom: clamp(30px, calc(3.6vh + 8px), 54px);
        width: min(38vw, 245px);
        min-width: 150px;
        transform: translate3d(0, 0, 0);
      }

      .difficulty-grid {
        width: fit-content;
        max-width: 100%;
        grid-template-columns: repeat(2, minmax(199px, 242px));
        justify-content: center;
        gap: 6px;
      }

      .difficulty-view {
        gap: 10px;
        padding-inline: 8px;
      }

      .difficulty-btn {
        font-size: clamp(0.86rem, 2.1vw, 1rem);
        line-height: 1.1;
        padding: 8px 8px;
        min-height: 64px;
        box-shadow: 3px 3px 0 #181726;
      }

      .difficulty-btn small {
        margin-top: 2px;
        font-size: clamp(0.76rem, 1.9vw, 0.88rem);
        line-height: 1.05;
      }

      .reveal-topbar {
        left: 0;
        right: 0;
        width: min(92vw, 500px);
        min-width: 0;
        max-width: min(92vw, 500px);
        margin-inline: auto;
        box-sizing: border-box;
        padding-inline: 9px;
        top: 6px;
        gap: 8px;
      }

      .reveal-topbar .action-btn {
        min-width: 0;
        white-space: nowrap;
        font-size: clamp(0.85rem, 2.1vw, 0.95rem);
        padding-inline: 9px;
      }

      .reveal-topbar #changeDifficultyBtn {
        margin-right: 4px;
      }

    .reveal-view.is-ready .reveal-core {
      width: min(92vw, 500px);
      min-width: 0;
      max-width: min(92vw, 500px);
    }

    .reveal-progress-wrap {
      width: min(88vw, 480px);
      top: 6px;
      padding: 6px 8px;
    }

    .reveal-progress {
      font-size: clamp(0.85rem, 2.2vw, 1rem);
    }

    .reveal-frame-wrap {
      width: min(92vw, 500px);
      min-width: 0;
      max-width: min(92vw, 500px);
      max-height: none;
    }

    .reveal-content {
      width: 100%;
      max-height: none;
      aspect-ratio: 1 / 1;
      border-width: 3px;
      box-shadow: 4px 6px 0 #16152a;
      overflow: hidden;
    }

    .reveal-nav {
      width: clamp(40px, 6vw, 54px);
      height: clamp(64px, 11vh, 82px);
      background: #fef8e5;
    }

    .reveal-nav:active {
      transform: translateY(-50%) scale(0.98);
    }

    .riddle-section {
      width: min(100%, 940px);
      gap: 7px;
      bottom: 8px;
      font-family: Calibri, Arial, sans-serif;
      cursor: auto;
      justify-items: center;
      text-align: justify;
      text-align-last: left;
      font-size: 22px;
    }

.reveal-view.is-riddle-mode .riddle-section {
  left: 0;
  right: 0;
  width: min(92vw, 500px);
  min-width: 0;
  max-width: min(92vw, 500px);
  top: clamp(58px, 9vh, 74px);
  bottom: clamp(74px, 10.8vh, 94px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

    .reveal-view.is-riddle-mode .reveal-frame-wrap {
      width: min(92vw, 500px);
      min-width: 0;
      max-width: min(92vw, 500px);
      aspect-ratio: auto;
      height: min(74vh, calc(var(--app-viewport-height) - 160px));
      min-height: clamp(360px, 60vh, 560px);
    }

    .reveal-view.is-riddle-mode .reveal-content {
      height: 100%;
      aspect-ratio: auto;
    }

    .reveal-view.is-riddle-mode .riddle-section {
      left: 0;
      right: 0;
      width: min(92vw, 500px);
      min-width: 0;
      max-width: min(92vw, 500px);
      top: clamp(58px, 8vh, 74px);
      bottom: clamp(8px, 1.8vh, 16px);
      padding: clamp(8px, 2.4vw, 12px);
      overflow-y: auto;
      overflow-x: hidden;
      overscroll-behavior-y: contain;
      touch-action: pan-y;
      -webkit-overflow-scrolling: touch;
    }

      .reveal-view.is-riddle-mode .riddle-panel {
        overflow-y: auto;
      }

    .reveal-view.is-portrait-mode .riddle-section {
      left: 0;
      right: 0;
      width: min(92vw, 500px);
      min-width: 0;
      max-width: min(92vw, 500px);
      top: clamp(72px, 11vh, 92px);
      bottom: clamp(84px, 12vh, 106px);
    }

    .riddle-panel {
      padding: 7px 9px 8px;
      gap: 6px;
      justify-items: center;
    }

    .riddle-form {
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      margin-top: 2px;
    }

    .riddle-form button {
      min-height: 42px;
      font-size: 22px;
    }

    .riddle-form input {
      min-height: 42px;
      font-size: 22px;
      text-align: justify;
      text-align-last: left;
    }

    .progress-points {
      width: min(92vw, 520px);
      gap: 7px;
    }

    .progress-point {
      width: 20px;
      height: 20px;
      border-width: 2px;
    }

    .reveal-actions {
      width: auto;
      left: auto;
      right: auto;
      top: auto;
    }

    .reveal-actions .action-btn.secondary {
      min-height: 42px;
      min-width: 0;
      padding-inline: 10px;
    }

    .reveal-hint {
      display: none;
    }

    .reveal-clue-card {
      width: min(94vw, 620px);
      padding: 12px;
      gap: 8px;
    }

    .clue-text,
    .clue-card {
      display: none !important;
    }

    .clues-panel {
      display: none !important;
    }
  }

    @media (max-width: 560px) {
      .difficulty-grid {
        grid-template-columns: repeat(2, minmax(185px, 216px));
        gap: 5px;
      }

      .difficulty-btn {
        font-size: 0.82rem;
        padding: 8px 7px;
        min-height: 58px;
      }

      .difficulty-btn small {
        margin-top: 1px;
        font-size: 0.72rem;
        line-height: 1.05;
      }

      .selection-auth-zone {
        margin: 0 2px 4px auto;
      }

      .reveal-view.is-riddle-mode .reveal-frame-wrap {
        width: min(94vw, 460px);
        min-width: 0;
        max-width: min(94vw, 460px);
        height: min(70vh, calc(var(--app-viewport-height) - 180px));
        min-height: clamp(330px, 56vh, 500px);
      }

      .reveal-view.is-riddle-mode .riddle-section {
        left: 0;
        right: 0;
        width: min(94vw, 460px);
        min-width: 0;
        max-width: min(94vw, 460px);
        top: clamp(56px, 8.5vh, 70px);
        bottom: 8px;
      }

      .portraits {
        grid-template-columns: auto;
        justify-content: center;
        width: 600px;
        min-width: 600px;
        max-width: 100%;
        margin-inline: auto;
        gap: 6px;
      }

      .calcea-art {
        right: 0;
        bottom: clamp(24px, calc(3.2vh + 8px), 46px);
        width: min(46vw, 198px);
        min-width: 135px;
        transform: translate3d(0, 0, 0);
      }

      .portraits > .portrait,
      .portraits > .portrait:nth-child(4),
      .portraits > .portrait:nth-child(5),
      .portraits > .portrait:nth-child(6) {
        grid-column: auto;
      }
    }

    /*
     * Suppression des ombres des cadres (conteneurs/panneaux).
     */
    .portrait,
    .qr-card,
    .card-progress,
    .progress-pill,
    .reveal-topbar,
    .reveal-frame-wrap,
    .reveal-content,
    .reveal-progress-wrap,
    .riddle-section,
    .riddle-panel,
    .wrong-answers,
    .riddle-solved-prompt,
    .riddle-feedback,
    .selection-login-card,
    .reveal-clue-card {
      box-shadow: none !important;
    }

    .portrait,
    .qr-card,
    .card-progress,
    .progress-pill,
    .reveal-topbar,
    .reveal-frame-wrap,
    .reveal-content,
    .reveal-progress-wrap,
    .riddle-section,
    .riddle-panel,
    .riddle-form input,
    .wrong-answers,
    .riddle-solved-prompt,
    .riddle-feedback,
    .selection-login-card,
    .reveal-clue-card {
      border-width: 1px !important;
    }

    #togglePortraitBtn,
    #changeDifficultyBtn,
    #answerSubmitBtn,
    .reveal-nav,
    #riddleAnswerInput {
      border-width: 1px !important;
      box-shadow: 1px 1px 0 #181726 !important;
    }

    #togglePortraitBtn:hover,
    #togglePortraitBtn:focus-visible,
    #changeDifficultyBtn:hover,
    #changeDifficultyBtn:focus-visible,
    #answerSubmitBtn:hover,
    #answerSubmitBtn:focus-visible,
    .reveal-nav:hover,
    .reveal-nav:focus-visible {
      box-shadow: 2px 2px 0 #181726 !important;
    }

    #riddleAnswerInput:focus-visible {
      box-shadow: 2px 2px 0 #181726 !important;
    }

    .reveal-nav:hover,
    .reveal-nav:focus-visible {
      transform: translateY(-50%) translateX(-1px) !important;
    }

    @media (prefers-reduced-motion: reduce) {
      * {
        animation: none !important;
        transition: none !important;
      }

      body.calcea-active .calcea-cap {
        opacity: 0.96 !important;
        transform: translate3d(var(--x-mid), var(--y-mid), 0) rotate(0deg) scale(1) !important;
      }

      body.calcea-active .calcea-cap .cap-full {
        opacity: 1 !important;
      }

      body.calcea-active .calcea-cap .cap-half {
        opacity: 0 !important;
      }
    }

    /*
     * Riddle full-content safety:
     * Le cadre enigme ne doit jamais couper son contenu.
     */
    .reveal-view.is-riddle-mode .reveal-core,
    .reveal-view.is-riddle-mode .reveal-frame-wrap,
    .reveal-view.is-riddle-mode .reveal-content,
    .reveal-view.is-riddle-mode .riddle-section,
    .reveal-view.is-riddle-mode .riddle-panel,
    .reveal-view.is-riddle-mode .riddle-question,
    .reveal-view.is-riddle-mode .wrong-answers {
      height: auto !important;
      min-height: 0 !important;
      max-height: none !important;
      overflow: visible !important;
    }

    .reveal-view.is-riddle-mode .reveal-frame-wrap,
    .reveal-view.is-riddle-mode .reveal-content {
      aspect-ratio: auto !important;
    }

    .reveal-view.is-riddle-mode .riddle-section {
      position: relative !important;
      inset: auto !important;
      top: auto !important;
      right: auto !important;
      bottom: auto !important;
      left: auto !important;
      display: grid !important;
      align-content: start !important;
    }

    .reveal-view.is-riddle-mode .riddle-panel {
      display: grid !important;
      align-content: start !important;
    }

    .reveal-view.is-riddle-mode .riddle-question img,
    .reveal-view.is-riddle-mode .riddle-question video,
    .reveal-view.is-riddle-mode .riddle-question iframe,
    .reveal-view.is-riddle-mode .riddle-question canvas,
    .reveal-view.is-riddle-mode .riddle-question svg {
      display: block;
      max-width: 100% !important;
      height: auto !important;
      margin-inline: auto;
      object-fit: contain;
    }

    /*
     * Correctif mobile : recentre les blocs principaux dans le viewport.
     * Garde la largeur minimale demandee (600px) sans ecraser la mise en page.
     */
    @media (max-width: 760px) {
      body {
        display: block;
      }

      .container {
        width: max-content;
        min-width: 600px;
        margin-inline: auto;
      }

      .hero,
      .game-area,
      .stage-view,
      .difficulty-view,
      .reveal-view {
        margin-inline: auto;
      }

      .game-title,
      .hint {
        text-align: center;
      }

      .selection-auth-zone,
      .portraits,
      .difficulty-grid,
      .reveal-view.is-ready .reveal-core,
      .reveal-topbar,
      .reveal-frame-wrap,
      .reveal-view.is-riddle-mode .riddle-section,
      .reveal-view.is-portrait-mode .riddle-section {
        margin-inline: auto !important;
      }

      .reveal-view,
      .reveal-view.is-riddle-mode,
      .reveal-view.is-riddle-mode .reveal-core,
      .reveal-view.is-riddle-mode .reveal-frame-wrap,
      .reveal-view.is-riddle-mode .reveal-content {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
      }

      .reveal-view.is-riddle-mode .riddle-section {
        position: relative !important;
        inset: auto !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 10px !important;
        padding-bottom: 12px !important;
      }

      .reveal-view.is-riddle-mode .riddle-panel,
      .reveal-view.is-riddle-mode .wrong-answers {
        max-height: none !important;
        overflow: visible !important;
      }

      .reveal-view.is-riddle-mode .riddle-question {
        overflow-wrap: anywhere;
      }

      /*
       * Correctif final mobile:
       * le cadre reveal doit contenir toute l'enigme (question + reponse + bouton).
       */
      .reveal-view.is-riddle-mode .reveal-core,
      .reveal-view.is-riddle-mode .reveal-frame-wrap {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
      }

      .reveal-view.is-riddle-mode .reveal-frame-wrap {
        aspect-ratio: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-top: 112px !important;
        padding-bottom: 14px !important;
      }

      .reveal-view.is-riddle-mode .reveal-topbar {
        position: absolute !important;
        top: 8px !important;
        left: 12px !important;
        right: 12px !important;
        z-index: 17 !important;
      }

      .reveal-view.is-riddle-mode .reveal-content {
        display: none !important;
      }

      .reveal-view.is-riddle-mode .riddle-section {
        position: relative !important;
        inset: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding: 0 8px !important;
        overflow: visible !important;
        z-index: 12 !important;
      }

      .reveal-view.is-riddle-mode .riddle-panel,
      .reveal-view.is-riddle-mode .riddle-question,
      .reveal-view.is-riddle-mode .riddle-form,
      .reveal-view.is-riddle-mode .riddle-feedback,
      .reveal-view.is-riddle-mode .wrong-answers {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
      }
    }

    .riddle-question {
      margin-top: 40px !important;
    }

    /*
     * Navigation enigmes sans chevauchement:
     * Les fleches sont placees dans des colonnes dediees, jamais sur le texte.
     */
    .reveal-view.is-riddle-mode .reveal-frame-wrap {
      display: grid !important;
      grid-template-columns: clamp(40px, 4.8vw, 58px) minmax(0, 1fr) clamp(40px, 4.8vw, 58px) !important;
      grid-template-rows: auto auto !important;
      grid-template-areas:
        "topbar topbar topbar"
        "prev riddle next" !important;
      column-gap: 10px !important;
      row-gap: 8px !important;
      align-items: start !important;
    }

    .reveal-view.is-riddle-mode .reveal-topbar {
      grid-area: topbar !important;
      position: relative !important;
      top: auto !important;
      left: auto !important;
      right: auto !important;
      margin: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
    }

    .reveal-view.is-riddle-mode .reveal-nav {
      position: relative !important;
      top: auto !important;
      left: auto !important;
      right: auto !important;
      transform: none !important;
      align-self: start !important;
      z-index: 8 !important;
    }

    .reveal-view.is-riddle-mode .reveal-nav-left {
      grid-area: prev !important;
      justify-self: center !important;
    }

    .reveal-view.is-riddle-mode .reveal-nav-right {
      grid-area: next !important;
      justify-self: center !important;
    }

    .reveal-view.is-riddle-mode .riddle-section {
      grid-area: riddle !important;
      position: relative !important;
      inset: auto !important;
      left: auto !important;
      right: auto !important;
      top: auto !important;
      bottom: auto !important;
      transform: none !important;
      margin: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      z-index: 7 !important;
    }

    /*
     * RESET CONTAINMENT:
     * Portrait + progression + difficulte restent dans reveal-core.
     */
    .reveal-view.is-ready .reveal-core {
      position: relative !important;
      display: block !important;
      overflow: visible !important;
    }

    .reveal-view.is-ready .reveal-frame-wrap {
      position: relative !important;
      display: block !important;
      overflow: visible !important;
    }

    .reveal-view.is-ready .reveal-topbar {
      position: absolute !important;
      top: 8px !important;
      left: 12px !important;
      right: 12px !important;
      width: auto !important;
      max-width: none !important;
      margin: 0 !important;
      transform: none !important;
      z-index: 17 !important;
      grid-area: auto !important;
    }

    .reveal-view.is-ready .reveal-topbar .reveal-progress-wrap {
      position: static !important;
      top: auto !important;
      left: auto !important;
      right: auto !important;
      transform: none !important;
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
      grid-area: progress !important;
    }

    .reveal-view.is-ready .reveal-topbar #togglePortraitBtn {
      grid-area: portrait !important;
    }

    .reveal-view.is-ready .reveal-topbar .reveal-actions {
      grid-area: actions !important;
    }

    /*
     * Visibilite complete de la zone enigme :
     * neutralise les overflow qui coupaient le contenu.
     */
    body.view-reveal {
      overflow-y: auto !important;
    }

    body.view-reveal #revealView.is-riddle-mode,
    body.view-reveal #revealView.is-riddle-mode .reveal-core,
    body.view-reveal #revealView.is-riddle-mode .reveal-frame-wrap,
    body.view-reveal #revealView.is-riddle-mode .reveal-content,
    body.view-reveal #revealView.is-riddle-mode .riddle-section,
    body.view-reveal #revealView.is-riddle-mode .riddle-panel,
    body.view-reveal #revealView.is-riddle-mode .riddle-question,
    body.view-reveal #revealView.is-riddle-mode .riddle-form,
    body.view-reveal #revealView.is-riddle-mode .riddle-feedback,
    body.view-reveal #revealView.is-riddle-mode .wrong-answers {
      overflow: visible !important;
      max-height: none !important;
      height: auto !important;
    }

    body.view-reveal #revealView.is-riddle-mode .riddle-panel,
    body.view-reveal #revealView.is-riddle-mode .wrong-answers {
      overflow-y: visible !important;
    }

    /*
     * Fix nav enigmes:
     * les fleches restent de part et d'autre du cadre enigme.
     */
    .reveal-view.is-riddle-mode .reveal-frame-wrap {
      position: relative !important;
      display: block !important;
      padding-left: clamp(52px, 5.5vw, 72px) !important;
      padding-right: clamp(52px, 5.5vw, 72px) !important;
    }

    .reveal-view.is-riddle-mode .reveal-nav {
      position: absolute !important;
      top: 50% !important;
      transform: translateY(-50%) !important;
      z-index: 20 !important;
    }

    .reveal-view.is-riddle-mode .reveal-nav-left {
      left: 8px !important;
    }

    .reveal-view.is-riddle-mode .reveal-nav-right {
      right: 8px !important;
    }

    .reveal-view.is-riddle-mode .reveal-nav:hover,
    .reveal-view.is-riddle-mode .reveal-nav:focus-visible {
      transform: translateY(-50%) !important;
    }

    /*
     * Correctif final scroll enigmes:
     * quand la hauteur viewport est insuffisante, la zone enigme doit scroller.
     */
    body.view-reveal,
    body.view-reveal .hero,
    body.view-reveal .game-area,
    body.view-reveal .stage-view,
    body.view-reveal #revealView {
      overflow-y: auto !important;
      overflow-x: hidden !important;
      max-height: none !important;
      overscroll-behavior-y: contain !important;
      touch-action: pan-y !important;
      -webkit-overflow-scrolling: touch;
    }

    body.view-reveal #revealView.is-riddle-mode .riddle-section,
    body.view-reveal #revealView.is-riddle-mode .riddle-panel,
    body.view-reveal #revealView.is-riddle-mode .riddle-question,
    body.view-reveal #revealView.is-riddle-mode .wrong-answers {
      overflow-y: auto !important;
      overflow-x: hidden !important;
      max-height: none !important;
      touch-action: pan-y !important;
      -webkit-overflow-scrolling: touch;
    }

    /*
     * Topbar: ligne 1 = Portrait + Difficulte, ligne 2 = Progression.
     */
    .reveal-view.is-ready .reveal-topbar {
      grid-template-columns: minmax(0, 1fr) auto !important;
      grid-template-areas:
        "portrait actions"
        "progress progress" !important;
      row-gap: 10px !important;
      column-gap: 8px !important;
      align-items: center !important;
    }

    .reveal-view.is-ready .reveal-topbar #togglePortraitBtn {
      grid-area: portrait !important;
      justify-self: start !important;
    }

    .reveal-view.is-ready .reveal-topbar .reveal-actions {
      grid-area: actions !important;
      justify-self: end !important;
    }

    .reveal-view.is-ready .reveal-topbar .reveal-progress-wrap {
      grid-area: progress !important;
      position: static !important;
      inset: auto !important;
      top: auto !important;
      right: auto !important;
      bottom: auto !important;
      left: auto !important;
      transform: none !important;
      width: 100% !important;
      margin: 0 !important;
    }

    /*
     * Structure en 3 lignes en mode enigme:
     * 1) Portrait + Difficulte
     * 2) Progression
     * 3) Bloc enigme
     */
    .reveal-view.is-riddle-mode .reveal-frame-wrap {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) !important;
      grid-auto-rows: max-content !important;
      align-content: start !important;
      row-gap: 8px !important;
      padding-left: 0 !important;
      padding-right: 0 !important;
    }

    .reveal-view.is-riddle-mode .reveal-topbar {
      position: static !important;
      top: auto !important;
      right: auto !important;
      bottom: auto !important;
      left: auto !important;
      transform: none !important;
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
      grid-area: auto !important;
    }

    .reveal-view.is-riddle-mode .riddle-section {
      position: static !important;
      inset: auto !important;
      top: auto !important;
      right: auto !important;
      bottom: auto !important;
      left: auto !important;
      transform: none !important;
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
      grid-area: auto !important;
      z-index: 7 !important;
    }

    /*
     * Verrou final navigation enigmes:
     * fleches calees a gauche/droite du cadre, a la hauteur de la progression.
     */
    .reveal-view.is-riddle-mode .reveal-frame-wrap {
      position: relative !important;
      display: block !important;
      padding-left: 0 !important;
      padding-right: 0 !important;
    }

    .reveal-view.is-riddle-mode .reveal-content {
      display: none !important;
    }

    .reveal-view.is-riddle-mode .reveal-topbar {
      position: static !important;
      inset: auto !important;
      transform: none !important;
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
      padding-left: clamp(46px, 5.4vw, 66px) !important;
      padding-right: clamp(46px, 5.4vw, 66px) !important;
      z-index: auto !important;
    }

    .reveal-view.is-riddle-mode .reveal-nav {
      position: absolute !important;
      top: var(--riddle-progress-center-y, 92px) !important;
      transform: translateY(-50%) !important;
      z-index: 20 !important;
      height: clamp(50px, 7.2vh, 62px) !important;
    }

    .reveal-view.is-riddle-mode .reveal-nav-left {
      left: 0 !important;
    }

    .reveal-view.is-riddle-mode .reveal-nav-right {
      right: 0 !important;
    }

    .reveal-view.is-riddle-mode .reveal-nav:hover,
    .reveal-view.is-riddle-mode .reveal-nav:focus-visible {
      transform: translateY(-50%) !important;
    }

    .reveal-view.is-riddle-mode .riddle-section {
      position: static !important;
      inset: auto !important;
      transform: none !important;
      margin: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      z-index: auto !important;
    }

    /* Suppression des espaces superflus entre progression et cadre enigme. */
    .reveal-view.is-riddle-mode .reveal-frame-wrap {
      row-gap: 0 !important;
    }

    .reveal-view.is-riddle-mode .reveal-topbar {
      margin-bottom: 0 !important;
      padding-bottom: 0 !important;
      row-gap: 6px !important;
    }

    .reveal-view.is-riddle-mode .riddle-section {
      margin-top: 0 !important;
      padding-top: 0 !important;
    }

    .reveal-view.is-riddle-mode .riddle-question {
      margin-top: 0 !important;
    }

    @media (max-width: 800px) {
      .hero {
        padding-top: clamp(86px, 14vh, 120px) !important;
      }

      .selection-reset-zone {
        position: fixed !important;
        top: 10px !important;
        left: max(8px, calc((100vw - 1100px) / 2 + 8px)) !important;
        right: auto !important;
        transform: none !important;
        z-index: 60 !important;
      }

      .selection-auth-zone {
        position: fixed !important;
        top: 10px !important;
        right: max(8px, calc((100vw - 1100px) / 2 + 8px)) !important;
        left: auto !important;
        transform: none !important;
        z-index: 60 !important;
      }

      .selection-title-zone {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        margin: 0 auto 6px !important;
        width: 100% !important;
        text-align: center !important;
        z-index: 5 !important;
      }
    }

    /* Verrou global: Connexion + Remise a zero restent fixes en haut au scroll. */
    .selection-auth-zone,
    .selection-reset-zone {
      position: fixed !important;
      top: max(8px, env(safe-area-inset-top, 0px)) !important;
      z-index: 60 !important;
    }

    .selection-auth-zone.is-scrolled-out,
    .selection-reset-zone.is-scrolled-out {
      opacity: 0 !important;
      visibility: hidden !important;
      pointer-events: none !important;
      transition: opacity 0.16s ease, visibility 0s linear 0.16s;
    }
