/* Labyrinthe des Nombres — complète shared/theme.css */
.rules { color: var(--muted); font-size: .9rem; line-height: 1.45; margin: 12px 0 0; }
.rules b { color: var(--text); }
h2 .g { background: var(--card); color: var(--accent-text); border-radius: 999px; padding: 2px 9px; margin-left: 6px; letter-spacing: 0; font-size: .8em; }
.world .ds .nt { color: var(--accent-text); }

/* Menu : un bouton par monde */
.worlds { display: grid; gap: 10px; }
.world { background: var(--card); border: 3px solid transparent; text-align: left; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; column-gap: 12px; padding: 12px 14px; min-height: 72px; }
.world .ico { font-size: 1.9rem; text-align: center; }
.world .nm { font-weight: 800; font-size: 1.02rem; line-height: 1.2; }
.world .ds { font-size: .78rem; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.world .st { font-weight: 800; font-size: .85rem; text-align: right; white-space: nowrap; }
.world.next { border-color: var(--accent); background: var(--card-hi); }
.world.locked { opacity: .5; }
.world:disabled { cursor: default; }

/* Barre du haut du labyrinthe */
.quizbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.maze-info { font-weight: 800; color: var(--muted); text-align: center; flex: 1; font-size: .9rem; }
.loot { background: var(--card); border-radius: 999px; padding: 8px 12px; letter-spacing: 2px; white-space: nowrap; min-width: 44px; text-align: center; }
.loot .off { filter: grayscale(1) opacity(.4); }

/* Labyrinthe */
.maze { display: grid; grid-auto-rows: minmax(0, 1fr); container-type: inline-size; margin: 12px auto 0; width: 100%; max-width: 440px; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #0d1030; border: 3px solid #0d1030; box-shadow: 0 6px 18px rgba(0,0,0,.4); touch-action: manipulation; }
.tile { display: grid; place-items: center; font-size: clamp(13px, 4.4vw, 22px); font-size: calc((100cqw - 6px) / 11 * .72); line-height: 1; min-width: 0; min-height: 0; overflow: hidden; }
.tile.wall { background: #0d1030; }
.tile.floor { background: var(--card-hi); }
.tile.seen { background: #4553a8; }
.tile.door { background: #5b3b12; animation: glow 1.6s ease-in-out infinite; }
.tile.me { z-index: 1; animation: bob .7s ease-in-out infinite alternate; }
@keyframes glow { 50% { box-shadow: inset 0 0 8px 2px rgba(255, 202, 40, .7); } }
@keyframes bob { to { transform: translateY(-2px); } }

.dpad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 58px); gap: 8px; justify-content: center; margin: 14px 0 6px; }
.dpad button { background: var(--card); font-size: 1.3rem; border-radius: 16px; border: 3px solid transparent; }
.dpad button:active { background: var(--card-hi); border-color: var(--accent); }
.dpad .up { grid-column: 2; grid-row: 1; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; }

/* Question : feuille posée en bas de l'écran */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(8, 10, 30, .7); padding: 0 0 env(safe-area-inset-bottom); overflow-y: auto; animation: fade .2s ease; }
.sheet .qcard { width: 100%; max-width: 560px; margin: auto auto 0; border-radius: 22px 22px 0 0; max-height: 100dvh; overflow-y: auto; }
.qcard { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
.qcard > * { max-width: 100%; }
.qcard .answers, .qcard .typed, .qcard .feedback { width: 100%; }
.q-line { overflow-wrap: anywhere; }
.q-hint { background: var(--action-tint); color: var(--action-ink); border-radius: 12px; padding: 8px 12px; font-size: var(--fs-small); line-height: 1.35; }
.typed input { width: 100%; font: inherit; font-size: 1.4rem; font-weight: 800; padding: 14px; border-radius: 14px; border: 3px solid var(--card-hi); background: var(--bg); color: var(--text); user-select: text; -webkit-user-select: text; }
.typed input.ok { border-color: var(--good-line); background: var(--good-tint); color: var(--good-ink); }
.typed input.ko { border-color: var(--bad-line); background: var(--bad-tint); color: var(--bad-ink); }
.sheet[hidden], #btn-next-world[hidden], .answers[hidden], .feedback[hidden], .typed[hidden], .q-hint[hidden], #btn-retry[hidden] { display: none; }

/* Résultat */
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.res-loot { font-size: 1.8rem; letter-spacing: 4px; margin: 4px 0; }
.res-loot .off { filter: grayscale(1) opacity(.4); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-height: 700px) { .dpad { grid-template-rows: repeat(2, 50px); } }

/* Écran d'un sujet */
.top h1#sub-title { font-size: .95rem; }
.howto { background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; font-size: .85rem; line-height: 1.45; color: var(--muted); }
.howto b { color: var(--text); }
.howto ul { margin: 6px 0 0; padding-left: 1.2rem; }
.notions { background: var(--card); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; font-size: .85rem; }
.notions summary { font-weight: 800; cursor: pointer; }
.notions ul { margin: 8px 0 0; padding-left: 1.2rem; line-height: 1.5; color: var(--muted); }
.notions li.ok { color: var(--ok); }
.level-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 18px 0 8px; }
.level-h h2 { margin: 0; }
.level-h .lv { color: var(--muted); font-size: .8rem; font-weight: 700; }
.level-h.locked { opacity: .55; }
.lvl-note { color: var(--muted); font-size: .8rem; margin: -2px 0 8px; }

/* Choix du personnage */
.hero-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border-radius: var(--radius); padding: 8px 14px; margin: 12px 0 0; font-weight: 800; font-size: .9rem; }
.hero-pick #heroes { display: flex; gap: 8px; }
.hero-pick button { background: var(--card-hi); width: 48px; height: 48px; font-size: 1.6rem; border-radius: 14px; border: 3px solid transparent; }
.hero-pick button.on { border-color: var(--accent); }

/* Figures des questions (droite graduée…) */
.q-figure { background: var(--bg); border-radius: 14px; padding: 8px; margin: -2px 0 12px; color: var(--text); }
.q-figure svg { width: 100%; height: auto; display: block; }
.q-figure[hidden] { display: none; }

/* Choix de l'année (palier du programme) */
.bands { margin: 14px 0 0; }
.bands > button { position: relative; min-height: 44px; }
.bands > button.mine::after { content: '★'; position: absolute; top: 2px; right: 8px; font-size: .7rem; color: var(--accent-text); }
.band-note { color: var(--muted); font-size: .8rem; margin: 6px 2px 0; min-height: 1.2em; }
.empty-band { color: var(--muted); text-align: center; padding: 24px 12px; background: var(--card); border-radius: var(--radius, 18px); }
