/* Direction « vitrine de jouets » : décor clair, cartes blanches en relief comme des boutons de jouet en plastique,
   vitrine bleu cobalt pour le héros, orange pour l'action, jaune pour les cristaux. Pas de contours noirs, pas de néon. */
:root {
  --sky: #eaf2ff;
  --sky-2: #d6e5ff;
  --cobalt: #2f6bff;
  --cobalt-deep: #1d4fd6;
  --cobalt-dark: #173fa8;
  --orange: #ff7a1a;
  --orange-deep: #d65a00;
  --yellow: #ffc928;
  --yellow-deep: #d9a200;
  --mint: #22c993;
  --mint-deep: #13996e;
  --pink: #ff5da2;
  --red: #f0435a;
  --ink: #1b2347;
  --ink-soft: #5b6488;
  --card: #ffffff;
  --card-edge: #c8d6f2;
  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  /* Andika : police conçue pour les enfants qui apprennent à lire (a et g « d'école », lettres bien espacées). */
  --body: 'Andika', 'Nunito', system-ui, -apple-system, sans-serif;
  --r: 22px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body, #root { margin: 0; min-height: 100%; }

body {
  font-family: var(--body);
  font-weight: 400;
  color: var(--ink);
  background-color: var(--sky);
  /* papier d'emballage : petites croix et ronds en filigrane */
  background-image:
    radial-gradient(circle at 12px 12px, var(--sky-2) 3px, transparent 3.5px),
    linear-gradient(var(--sky-2), var(--sky-2)), linear-gradient(var(--sky-2), var(--sky-2));
  background-size: 56px 56px, 14px 3px, 3px 14px;
  background-position: 0 0, 34px 39px, 39.5px 33.5px;
  background-repeat: repeat, repeat, repeat;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

input, textarea { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; touch-action: manipulation; }
button:disabled { opacity: 0.45; cursor: default; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }

.screen {
  max-width: 600px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 24px);
  min-height: 100dvh;
}
.screen.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; }

.display { font-family: var(--display); font-weight: 400; line-height: 1.05; margin: 0; font-size: 34px; letter-spacing: 0.3px; }
.display.small { font-size: 24px; }
.lead { font-size: 18px; line-height: 1.45; margin: 0; max-width: 30ch; color: var(--ink-soft); }
.small { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.kicker {
  display: inline-block; background: var(--yellow); color: var(--ink); font-size: 12px; text-transform: uppercase;
  letter-spacing: 1px; padding: 4px 10px; border-radius: 999px; font-weight: 900; box-shadow: 0 3px 0 var(--yellow-deep);
}
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- Barre du haut ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 16px; background: var(--card); color: var(--ink);
  box-shadow: 0 4px 0 var(--card-edge); font-size: 22px; display: grid; place-items: center; font-weight: 900;
}
.icon-btn.small { width: 38px; height: 38px; border-radius: 12px; font-size: 18px; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--card-edge); }

.wallet, .time-left {
  display: inline-flex; align-items: center; gap: 6px; background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 8px 16px 8px 10px; box-shadow: 0 4px 0 var(--card-edge); font-size: 19px; font-family: var(--display);
}
.time-left { background: var(--mint); color: #fff; padding: 8px 16px; box-shadow: 0 4px 0 var(--mint-deep); }

/* ---------- Boutons « jouet » ---------- */
.btn {
  font-family: var(--display); font-size: 19px; padding: 14px 22px; border-radius: 18px; letter-spacing: 0.3px;
  background: var(--card); color: var(--ink); box-shadow: 0 5px 0 var(--card-edge); transition: transform 0.06s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--card-edge); }
.btn.primary { background: var(--orange); color: #fff; box-shadow: 0 5px 0 var(--orange-deep); }
.btn.primary:active { box-shadow: 0 1px 0 var(--orange-deep); }
.btn.ghost { background: var(--card); color: var(--cobalt); }
.btn.danger { background: var(--red); color: #fff; box-shadow: 0 5px 0 #b72238; }
.btn.big { width: 100%; font-size: 23px; padding: 18px; }

.chip {
  padding: 8px 14px; border-radius: 999px; background: var(--card); color: var(--ink); font-weight: 900;
  box-shadow: 0 3px 0 var(--card-edge);
}
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--card-edge); }
.chip.on { background: var(--cobalt); color: #fff; box-shadow: 0 3px 0 var(--cobalt-dark); }

/* ---------- QG : la vitrine du héros ---------- */
.hero-card {
  display: flex; gap: 10px; align-items: flex-end; position: relative; overflow: hidden;
  background: linear-gradient(170deg, var(--cobalt) 0%, var(--cobalt-deep) 100%); color: #fff;
  border-radius: 28px; padding: 14px 16px 16px 8px; box-shadow: 0 7px 0 var(--cobalt-dark);
}
/* rayons de vitrine derrière le héros */
.hero-card::before {
  content: ''; position: absolute; left: -60px; top: -40px; width: 300px; height: 300px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.09) 0 10deg, transparent 10deg 20deg);
}
.hero-avatar { flex: none; position: relative; z-index: 1; padding-bottom: 6px; }
/* socle de figurine */
.hero-avatar::after {
  content: ''; position: absolute; left: 8%; right: 8%; bottom: 0; height: 22px; border-radius: 50%;
  background: radial-gradient(ellipse, #8fb4ff 0%, #5d8fff 60%, transparent 72%); z-index: -1;
}
.hero-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; z-index: 1; padding-bottom: 4px; }
.hero-info .display { font-size: 36px; word-break: break-word; text-shadow: 0 3px 0 var(--cobalt-dark); }
.hero-info .row { justify-content: flex-start; }
.hero-info .chip { box-shadow: 0 3px 0 var(--cobalt-dark); }
.xp-bar, .hp-bar { width: 100%; height: 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.18); overflow: hidden; }
.xp-bar > div { height: 100%; background: var(--yellow); border-radius: 999px; transition: width 0.6s; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12); }
.xp-label { font-size: 13px; opacity: 0.9; }

.section-title { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 28px 4px 12px; color: var(--ink); }

/* ---------- Cartes de mission ---------- */
.missions { display: flex; flex-direction: column; gap: 16px; }
.mission-card {
  display: flex; gap: 14px; align-items: center; text-align: left; padding: 10px 14px 10px 10px; border-radius: var(--r);
  background: var(--card); color: var(--ink); box-shadow: 0 6px 0 var(--card-edge); position: relative; overflow: hidden;
}
.mission-card::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 8px; background: var(--mission); }
.mission-card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--card-edge); }
.mc-monster { flex: none; border-radius: 18px; background: #fff; }
.mc-monster .monster { animation: bob 2.6s ease-in-out infinite; }
.mc-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #fff; background: var(--mission);
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-weight: 900;
}
.mc-name { font-family: var(--display); font-size: 23px; margin: 5px 0 2px; }
.mc-pitch { font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--ink-soft); }
.mc-wins { font-size: 12px; margin-top: 6px; color: var(--mint-deep); }

/* ---------- Mission ---------- */
.mission-top { display: flex; align-items: center; gap: 12px; }
.hp { flex: 1; }
.hp-label { font-family: var(--display); font-size: 17px; margin-bottom: 5px; }
.mission .hp-bar { background: var(--card); box-shadow: inset 0 0 0 3px var(--card-edge); }
.hp-bar > div { height: 100%; background: var(--mission); border-radius: 999px; transition: width 0.4s; }
.streak { min-width: 48px; font-family: var(--display); font-size: 24px; color: var(--orange); text-align: center; }

.arena {
  height: 190px; display: grid; place-items: center; position: relative; margin: 10px 0 4px;
  background: #fff; border-radius: 28px; box-shadow: 0 6px 0 var(--card-edge);
}
.monster { display: block; mix-blend-mode: multiply; filter: var(--mfilter, saturate(1)); }
.arena .monster { animation: bob 2s ease-in-out infinite; }
.monster.hurt { animation: hurt 0.45s ease-out, bob 2s ease-in-out 0.45s infinite !important; }
.pow {
  position: absolute; font-family: var(--display); font-size: 44px; color: var(--yellow);
  text-shadow: 0 4px 0 var(--orange-deep), 0 0 18px #fff; transform: rotate(-8deg); animation: pop 0.5s ease-out;
}

.consigne { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 16px; margin: 12px 2px 10px; }

.question-card {
  background: var(--card); border-radius: 28px; padding: 16px; box-shadow: 0 6px 0 var(--card-edge);
  display: flex; flex-direction: column; gap: 12px; border-top: 8px solid var(--mission);
}
.question-card.correct { border-top-color: var(--mint); }
.prompt { font-family: var(--display); font-size: 52px; text-align: center; line-height: 1.1; padding: 4px 0; }
.answer-display {
  font-family: var(--display); font-size: 42px; text-align: center; min-height: 68px; border-radius: 18px;
  display: grid; place-items: center; background: var(--sky); box-shadow: inset 0 3px 0 var(--sky-2);
}
.correct .answer-display { background: var(--mint); color: #fff; box-shadow: none; }
.bubble { border-radius: 18px; padding: 12px 14px; font-weight: 800; font-size: 16px; line-height: 1.4; }
.bubble.hint { background: #fff4c7; }
.bubble.solution { background: #ffe1ee; }
.bubble .small { margin-top: 4px; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.keypad button {
  font-family: var(--display); font-size: 30px; height: 64px; border-radius: 18px; background: var(--card); color: var(--ink);
  box-shadow: 0 5px 0 var(--card-edge);
}
.question-card .keypad button { background: var(--sky); box-shadow: 0 5px 0 var(--sky-2); }
.keypad button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--card-edge); }
.keypad .ok, .question-card .keypad .ok { background: var(--orange); color: #fff; font-size: 22px; box-shadow: 0 5px 0 var(--orange-deep); }
.keypad .del, .question-card .keypad .del { background: var(--sky-2); color: var(--ink); box-shadow: 0 5px 0 var(--card-edge); }

.listen {
  display: flex; align-items: center; justify-content: center; gap: 12px; font-family: var(--display); font-size: 27px;
  background: var(--cobalt); color: #fff; border-radius: 20px; padding: 18px; box-shadow: 0 5px 0 var(--cobalt-dark);
}
.listen:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--cobalt-dark); }
.text-answer { display: flex; flex-direction: column; gap: 10px; }
.text-answer input {
  font-family: var(--body); font-weight: 900; font-size: 28px; padding: 14px; border-radius: 18px; border: 3px solid var(--sky-2);
  background: var(--sky); color: var(--ink); text-align: center; outline: none; width: 100%;
}
.text-answer input:focus { border-color: var(--cobalt); background: #fff; }

.mission-end { display: flex; align-items: center; justify-content: center; }
.end-card {
  width: 100%; background: var(--card); border-radius: 30px; padding: 22px 18px; box-shadow: 0 7px 0 var(--card-edge);
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; border-top: 10px solid var(--mission);
}
.end-card.won { border-top-color: var(--yellow); }
.end-card.won .burst .monster { animation: defeated 1.2s ease-out forwards; }
.burst { height: 170px; display: grid; place-items: center; }
.burst > div { grid-area: 1 / 1; }
.burst-hero { opacity: 0; }
.end-card.won .burst-hero { animation: heroIn 0.6s ease-out 0.9s forwards; }
.end-card.fled .burst-hero { display: none; }
@keyframes heroIn { 0% { opacity: 0; transform: scale(0.6) translateY(20px); } 70% { transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }
.loot {
  display: flex; align-items: center; gap: 8px; font-size: 24px; font-family: var(--display); background: var(--yellow);
  padding: 8px 20px; border-radius: 999px; box-shadow: 0 4px 0 var(--yellow-deep);
}
.review { background: var(--sky); border-radius: 18px; padding: 12px 16px; width: 100%; text-align: left; }
.review h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 18px; }
.review ul { margin: 0; padding-left: 18px; line-height: 1.6; }

/* ---------- Vestiaire ---------- */
.editor-stage {
  display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 12px; padding: 12px 12px 16px;
  border-radius: 28px; position: relative; overflow: hidden;
  background: linear-gradient(170deg, var(--cobalt) 0%, var(--cobalt-deep) 100%); box-shadow: 0 7px 0 var(--cobalt-dark); color: #fff;
}
.editor-stage::before {
  content: ''; position: absolute; left: 50%; top: 40%; width: 520px; height: 520px; translate: -50% -50%; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.08) 0 10deg, transparent 10deg 20deg);
}
.editor-stage > * { position: relative; }
.hero-name {
  font-family: var(--display); font-size: 28px; text-align: center; background: rgba(255, 255, 255, 0.16); border: none;
  border-radius: 14px; color: #fff; width: 80%; outline: none; padding: 6px 10px;
}
.hero-name:focus { background: rgba(255, 255, 255, 0.28); }
.trial-note { font-size: 13px; background: var(--yellow); color: var(--ink); border-radius: 999px; padding: 4px 12px; box-shadow: 0 3px 0 var(--yellow-deep); }

.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 4px -16px 4px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 9px 16px; border-radius: 999px; font-weight: 900; font-size: 15px;
  background: var(--card); color: var(--ink); box-shadow: 0 3px 0 var(--card-edge);
}
.tab.active { background: var(--ink); color: #fff; box-shadow: 0 3px 0 #000; }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 12px 10px; }
.item {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 6px 7px; border-radius: 20px; position: relative;
  background: var(--card); color: var(--ink); box-shadow: 0 4px 0 var(--card-edge);
}
.item:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--card-edge); }
.item.active { box-shadow: 0 0 0 4px var(--cobalt), 0 4px 0 4px var(--cobalt-dark); }
.trying { outline: 3px dashed var(--orange); outline-offset: 3px; }
.item .price { position: absolute; top: -8px; right: -6px; }

.pick-group h3 { margin: 20px 2px 10px; font-family: var(--display); font-weight: 400; font-size: 19px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; min-width: 76px; border-radius: 18px;
  background: var(--card); box-shadow: 0 4px 0 var(--card-edge); position: relative;
}
.swatch.active { box-shadow: 0 0 0 4px var(--cobalt), 0 4px 0 4px var(--cobalt-dark); }
.swatch.locked .dot, .swatch.locked svg { opacity: 0.6; }
.swatch .dot { width: 34px; height: 34px; border-radius: 50%; display: block; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15), 0 0 0 2px rgba(27, 35, 71, 0.1); }
.swatches.colors { gap: 14px 10px; }
.swatch.color { min-width: 0; padding: 5px; border-radius: 50%; }
.swatch.color .price { position: absolute; bottom: -11px; font-size: 10px; padding: 0 5px; }
.dot.origin { background: conic-gradient(#f0435a, #ffc928, #22c993, #2f6bff, #9b5cff, #f0435a); }
.sw-label { font-size: 12px; font-weight: 800; }
.price {
  display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 900; background: var(--yellow); color: var(--ink);
  border-radius: 999px; padding: 2px 7px; box-shadow: 0 2px 0 var(--yellow-deep); white-space: nowrap;
}
.price.poor { background: var(--sky-2); box-shadow: 0 2px 0 var(--card-edge); }
.note { margin: 0 2px 10px; }
.sticky-cta { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 12px); margin-top: 26px; }

/* ---------- Badges ---------- */
.badges { display: flex; flex-direction: column; gap: 12px; }
.badge {
  display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 20px; background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
}
.badge.got { background: var(--card); color: var(--ink); box-shadow: 0 5px 0 var(--card-edge); }
.medal {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; flex: none;
  background: var(--sky-2); color: var(--ink-soft); font-family: var(--display);
}
.badge.got .medal { background: var(--yellow); color: var(--ink); box-shadow: inset 0 -5px 0 var(--yellow-deep); }

/* ---------- Parent (volontairement sobre) ---------- */
.parent { font-weight: 600; }
.parent-hero { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.parent-hero .display { font-size: 30px; }
.parent-hero p { margin: 0; line-height: 1.5; color: var(--ink-soft); }
.parent-form { display: flex; flex-direction: column; gap: 18px; background: var(--card); border-radius: 22px; padding: 18px; box-shadow: 0 5px 0 var(--card-edge); }
.parent-form label, .parent-form fieldset { display: flex; flex-direction: column; gap: 8px; font-weight: 800; border: none; padding: 0; margin: 0; }
.parent-form legend { font-weight: 800; margin-bottom: 8px; padding: 0; }
.parent-form input:not([type='range']), .parent-form textarea {
  font: inherit; font-weight: 700; font-size: 16px; padding: 12px; border-radius: 12px; border: 2px solid var(--sky-2); background: var(--sky); color: var(--ink);
}
.parent-form input:focus, .parent-form textarea:focus { outline: none; border-color: var(--cobalt); background: #fff; }
.parent-form input[type='range'] { accent-color: var(--cobalt); width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.parent-form .chip { background: var(--sky); box-shadow: 0 3px 0 var(--sky-2); }
.parent-form .chip.on { background: var(--cobalt); color: #fff; box-shadow: 0 3px 0 var(--cobalt-dark); }
.pin-row { display: flex; gap: 10px; }
.pin-row input { flex: 1; min-width: 0; letter-spacing: 6px; text-align: center; }
.error { color: var(--red); margin: 0; font-weight: 800; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--sky-2); padding: 5px; border-radius: 16px; }
.tabs button { flex: 1; padding: 10px; border-radius: 12px; font-weight: 900; color: var(--ink-soft); }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 0 var(--card-edge); }
.parent-body h3 { margin: 24px 0 10px; font-family: var(--display); font-weight: 400; font-size: 20px; }
.parent-body p { line-height: 1.5; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--card); border-radius: 16px; padding: 10px 6px; text-align: center; box-shadow: 0 4px 0 var(--card-edge); }
.stat span { display: block; font-size: 11px; text-transform: uppercase; color: var(--ink-soft); }
.stat strong { font-size: 24px; font-family: var(--display); font-weight: 400; }
.history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.history li { background: var(--card); border-radius: 14px; padding: 10px 12px; box-shadow: 0 3px 0 var(--card-edge); }
.h-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.h-top .ok { color: var(--mint-deep); }
.h-top .ko { color: var(--red); }
.h-errors { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-soft); margin-top: 6px; gap: 2px; }
.danger-zone { margin-top: 28px; padding: 16px; border-radius: 18px; border: 2px dashed #f59aa8; background: rgba(255, 255, 255, 0.5); }
.danger-zone h3 { color: var(--red); margin-top: 0; }

.parent-gate .keypad { max-width: 300px; }
.pin-dots { display: flex; gap: 14px; margin: 8px 0 18px; }
.pin-dots span { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px var(--card-edge); }
.pin-dots span.on { background: var(--cobalt); }
.pin-dots.shake { animation: shake 0.4s; }

/* ---------- Avatar en calques ---------- */
.avatar { position: relative; aspect-ratio: 1024 / 1720; flex: none; }
.avatar > .av-canvas { position: absolute; left: 0; right: 0; bottom: 0; aspect-ratio: 1024 / 1536; }
.av-layer { position: absolute; inset: 0; isolation: isolate; transform-origin: 50% 0; pointer-events: none; }
.av-layer img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.av-tint { position: absolute; inset: 0; mix-blend-mode: multiply; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.av-aura {
  position: absolute; left: 0; right: 0; top: 22%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--aura) 0%, transparent 66%); animation: pulse 2.4s ease-in-out infinite;
}
.av-thumb { position: relative; overflow: hidden; border-radius: 14px; background: var(--sky); }
.av-thumb.none { width: 64px; height: 64px; display: grid; place-items: center; font-size: 28px; color: var(--ink-soft); }

/* ---------- Animations ---------- */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes hurt { 0% { transform: translateX(0) scale(1); filter: var(--mfilter, saturate(1)) brightness(1.6); } 30% { transform: translateX(-12px) rotate(-6deg) scale(0.92); } 60% { transform: translateX(10px) rotate(5deg); } 100% { transform: translateX(0); } }
@keyframes pop { 0% { transform: scale(0.2) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.2) rotate(-6deg); opacity: 1; } 100% { transform: scale(1) rotate(-8deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.35; } 50% { transform: scale(1.06); opacity: 0.55; } }
@keyframes defeated { 0% { transform: scale(1) rotate(0); opacity: 1; } 40% { transform: scale(1.15) rotate(-10deg); filter: var(--mfilter, saturate(1)) brightness(1.5); } 100% { transform: scale(0.3) rotate(200deg) translateY(-60px); opacity: 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 700px) {
  /* tablette : tout grossit d'un cran plutôt que de laisser du vide */
  .screen { zoom: 1.2; max-width: 620px; }
  .prompt { font-size: 60px; }
  .keypad button { height: 72px; }
  .display { font-size: 40px; }
}
/* téléphones : l'arène se fait plus petite pour garder le clavier visible */
@media (max-height: 860px) and (max-width: 699px) {
  .arena { height: 136px; }
  .arena .monster { width: 118px; height: 118px; }
  .prompt { font-size: 44px; }
  .keypad button { height: 58px; }
}

/* ---------- Leçons et nature des mots ---------- */
:root { --wc-N: #2f6bff; --wc-A: #ff7a1a; --wc-V: #16a374; }
.lessons-entry {
  display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 18px; padding: 14px 16px; text-align: left;
  background: var(--card); border-radius: 20px; box-shadow: 0 5px 0 var(--card-edge); color: var(--ink); font-size: 22px;
}
.lessons-entry:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--card-edge); }
.le-icon { font-size: 30px; }
.le-body { display: flex; flex-direction: column; flex: 1; }
.le-body strong { font-family: var(--display); font-weight: 400; font-size: 22px; }
.lesson-list { display: flex; flex-direction: column; gap: 12px; }
.lesson-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 16px; border-radius: 18px;
  background: var(--card); box-shadow: 0 5px 0 var(--card-edge); color: var(--ink); border-left: 8px solid var(--cobalt);
}
.lesson-card strong { font-family: var(--display); font-weight: 400; font-size: 21px; }
.lesson-card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--card-edge); }
.lesson-head { margin: 8px 2px 14px; }
.lesson-head .display { margin: 4px 0 8px; font-size: 30px; }
.lesson-head .lead { max-width: none; }
.lesson-part { background: var(--card); border-radius: 20px; padding: 14px 16px; margin-bottom: 14px; box-shadow: 0 5px 0 var(--card-edge); border-left: 8px solid var(--wc-N); }
.wc-border-A { border-left-color: var(--wc-A); }
.wc-border-V { border-left-color: var(--wc-V); }
.lp-title { display: flex; align-items: center; justify-content: space-between; }
.lp-title h3 { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 0; }
.lesson-part p { font-size: 17px; line-height: 1.5; margin: 8px 0; }
.examples { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; font-size: 19px; font-weight: 800; }
.examples li { background: var(--sky); border-radius: 12px; padding: 8px 12px; }
.tip { background: #fff4c7; border-radius: 12px; padding: 10px 12px; }
mark.wc { background: none; font-weight: 900; border-bottom: 4px solid; padding: 0 1px; }
.wc-N { color: var(--wc-N); }
.wc-A { color: var(--wc-A); }
.wc-V { color: var(--wc-V); }
.lesson-overlay { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: var(--sky); }

.word-ask { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 900; font-size: 19px; margin-bottom: 10px; }
.sentence { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: baseline; justify-content: center; margin: 6px 0 14px; font-size: 24px; font-weight: 800; line-height: 1.2; }
.sentence .word { padding: 6px 9px; border-radius: 12px; color: var(--ink); }
.sentence span.word:not(.focus):not(.good):not(.bad) { padding-left: 1px; padding-right: 1px; }
.sentence span.word.focus { background: var(--yellow); box-shadow: 0 3px 0 #d9a400; }
.sentence button.word { background: var(--sky); box-shadow: 0 4px 0 var(--sky-2); font: inherit; }
.sentence button.word:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--sky-2); }
.sentence .word.good { background: var(--mint); color: #fff; box-shadow: 0 4px 0 #13966b; }
.sentence .word.bad { background: var(--red); color: #fff; box-shadow: 0 4px 0 #b72238; }
.sentence .wgroup { display: inline-flex; align-items: baseline; white-space: nowrap; }
.sentence .punct { margin-left: 1px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.prompt-text { font-family: var(--display); font-size: 34px; text-align: center; line-height: 1.15; margin: 4px 0 14px; }
.sentence .word.blank { min-width: 64px; text-align: center; }
.question-card .text-answer { margin-top: 4px; }
.btn.choice { padding: 16px 6px; font-size: 19px; background: var(--card); color: var(--ink); box-shadow: 0 5px 0 var(--card-edge); border: 3px solid var(--sky-2); }
.btn.choice.good { background: var(--mint); color: #fff; border-color: var(--mint); box-shadow: 0 5px 0 #13966b; }
.btn.choice.bad { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 5px 0 #b72238; }
.question-card .btn.big { margin-top: 12px; }

/* ---------- Matières (accueil) ---------- */
.subjects { display: flex; flex-direction: column; gap: 14px; }
.subject-tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-height: 118px; padding: 16px 18px; border-radius: 24px; text-align: left; color: #fff;
  background: var(--subject); box-shadow: 0 6px 0 color-mix(in srgb, var(--subject) 70%, #000);
}
.subject-tile:active { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--subject) 70%, #000); }
.subject-tile::before {
  content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.st-label { font-family: var(--display); font-size: 32px; line-height: 1; position: relative; }
.st-tagline { font-weight: 800; font-size: 15px; opacity: 0.92; position: relative; max-width: 60%; }
.st-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; position: relative; max-width: 62%; }
.st-meta span { background: rgba(255, 255, 255, 0.22); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 900; }
.st-monsters { position: absolute; right: 10px; bottom: 8px; display: flex; }
.st-monsters .monster { mix-blend-mode: normal; background: #fff; border-radius: 16px; margin-left: -10px; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15); }
.subject-tile.soon { background: #c9d3e6; box-shadow: 0 6px 0 #aab6cd; color: #5a6580; min-height: 84px; }
.subject-tile.soon::before { display: none; }
.subject .section-title { margin-top: 18px; }

/* ---------- Rubriques d'une matière ---------- */
.rubric-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.rubric-nav .chip { text-decoration: none; }
.rubric { scroll-margin-top: 12px; }
.rubric .lesson-list { margin-bottom: 14px; }
.rubric .lesson-card { border-left-color: var(--subject); }
.prompt-text.long { font-size: 26px; }
.choices.long { grid-template-columns: 1fr; }
.choices.long .btn.choice { padding: 14px 12px; }

/* Étoiles et niveaux des leçons */
.stars { color: #f5b301; letter-spacing: 2px; font-size: 26px; margin-top: 4px; }
.stars.small { font-size: 18px; display: block; margin-top: 4px; }
.stars.big { font-size: 40px; text-align: center; }
.level-line { text-align: center; margin: 0 0 10px; font-size: 16px; }
.two-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-btns .btn.ghost { background: var(--card, #fff); }
.level-progress { text-align: center; margin: 10px 0 4px; }
.level-progress .hp-bar { max-width: 260px; margin: 6px auto 0; }
.hint-btn { margin: 8px auto 0; display: block; }

/* Carte de leçon : le titre ouvre la leçon, trois boutons en dessous */
.lesson-card:active { transform: none; box-shadow: 0 5px 0 var(--card-edge); }
.lc-head { display: flex; flex-direction: column; gap: 4px; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; }
.lc-head strong { font-family: var(--display); font-weight: 400; font-size: 21px; }
.lc-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.lc-actions .btn { padding: 10px 6px; font-size: 15px; white-space: nowrap; }

/* ---------- Cartes à collectionner ---------- */
.tcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin-bottom: 18px; }
.tcard-grid.mini { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tcard { border-radius: 26px; padding: 10px; background: #b9c3d6; box-shadow: 0 8px 0 #8b96ab; color: #14213d; text-align: left; }
.tcard.r1 { background: linear-gradient(135deg, #f0b27a 0, #b8692b 45%, #f5c08d 60%, #9a5520 100%); box-shadow: 0 8px 0 #7a4115; }
.tcard.r2 { background: linear-gradient(135deg, #eef2f7 0, #aebccd 30%, #ffffff 50%, #9fb0c3 75%, #e2e9f1 100%); box-shadow: 0 8px 0 #7d8ea3; }
.tcard.r3 { background: linear-gradient(135deg, #fff3a6 0, #f2b705 35%, #fff6c2 52%, #d99a00 80%, #ffe066 100%); box-shadow: 0 8px 0 #a37200; }
.tcard.r4 {
  background: linear-gradient(135deg, #ff6b9a 0, #ffc94d 20%, #7ee081 40%, #5ec8ff 60%, #a78bff 80%, #ff6b9a 100%);
  background-size: 200% 200%; animation: holo 6s linear infinite;
  box-shadow: 0 8px 0 #7a4bd1, 0 0 26px rgba(167, 139, 255, 0.55);
}
@keyframes holo { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.tc-inner { border-radius: 18px; background: #fffaf0; overflow: hidden; display: flex; flex-direction: column; height: 100%; }
.tcard.r0 .tc-inner { background: #f4f6fa; }
.tc-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tc-art { position: relative; height: 190px; display: flex; align-items: flex-end; justify-content: center; background: radial-gradient(circle at 50% 62%, #ffffff 0, var(--rub-light) 40%, var(--rub) 100%); }
.tcard.r0 .tc-art { background: radial-gradient(circle at 50% 62%, #ffffff 0, #e4e9f1 55%, #c9d1de 100%); }
.tc-monster { width: 170px; height: 170px; object-fit: contain; mix-blend-mode: multiply; }
.tcard.r0 .tc-monster { opacity: 0.45; }
.tc-mystery { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -45%); font-family: 'Luckiest Guy', var(--display); font-size: 64px; color: #fff; text-shadow: 0 4px 0 #8b96ab; }
.tc-rubric { position: absolute; top: 10px; left: 10px; background: #14213d; color: #fff; font-weight: 900; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; }
.tc-rarity { position: absolute; top: 10px; right: 10px; font-weight: 900; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; background: #fff; color: #14213d; }
.tc-rarity.r1 { background: #b8692b; color: #fff; }
.tc-rarity.r2 { background: #eef2f7; color: #4a5a7a; }
.tc-rarity.r3 { background: #f2b705; color: #3b2a00; }
.tc-rarity.r4 { background: linear-gradient(90deg, #ff6b9a, #5ec8ff); color: #fff; }
.tc-num { position: absolute; bottom: 8px; right: 10px; font-family: 'Luckiest Guy', var(--display); font-size: 15px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.tc-body { padding: 12px 16px 6px; display: flex; flex-direction: column; gap: 8px; }
.tc-title { margin: 0; font-family: 'Luckiest Guy', var(--display); font-weight: 400; font-size: 27px; line-height: 1.05; letter-spacing: 0.3px; color: #14213d; }
.tc-short { font-size: 14px; font-weight: 800; color: #6b5a3e; }
.tc-stars { display: flex; gap: 4px; }
.tc-star { width: 30px; height: 30px; fill: #e9e1cf; stroke: #cdbb93; stroke-width: 1.5; stroke-linejoin: round; }
.tc-star.on { fill: #ffc400; stroke: #c88a00; }
.tc-level { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 900; color: #6b5a3e; }
.tc-level-text { display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: 0.3px; }
.tc-bar { height: 12px; border-radius: 999px; background: #efe3c8; overflow: hidden; }
.tc-bar > div { height: 100%; border-radius: 999px; background: #2bb673; }
.tc-actions { padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.tc-play { height: 54px; border: 0; border-radius: 16px; background: #2bb673; box-shadow: 0 5px 0 #17824f; color: #fff; font-family: 'Luckiest Guy', var(--display); font-size: 25px; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; }
.tcard.r4 .tc-play { background: #7a4bd1; box-shadow: 0 5px 0 #52309a; }
.tc-play:active { transform: translateY(4px); box-shadow: 0 1px 0 #17824f; }
.tc-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tc-btn { height: 46px; border: 3px solid #14213d; border-radius: 14px; background: #fff; color: #14213d; font-family: var(--body); font-weight: 900; font-size: 16px; cursor: pointer; }
.tc-btn:active { transform: translateY(2px); }
.tcard.mini { padding: 6px; border-radius: 18px; border: 0; cursor: pointer; font: inherit; }
.tcard.mini .tc-inner { border-radius: 13px; }
.tcard.mini .tc-art { height: 110px; }
.tcard.mini .tc-monster { width: 100px; height: 100px; }
.tcard.mini .tc-mystery { font-size: 40px; }
.tcard.mini .tc-rubric { display: none; }
.tcard.mini .tc-rarity { top: 6px; right: 6px; font-size: 10px; padding: 3px 8px; }
.tcard.mini .tc-body { padding: 8px 10px 10px; gap: 6px; }
.tcard.mini .tc-title { font-size: 17px; }
.tcard.mini .tc-star { width: 18px; height: 18px; }
.album-count { font-size: 17px; margin: 4px 2px 6px; color: var(--ink-soft); font-weight: 700; }
.album-count strong { color: var(--ink); font-size: 22px; }
@media (prefers-reduced-motion: reduce) { .tcard.r4 { animation: none; } }
/* Page matière et album : plus larges, pour mettre les cartes côte à côte sur iPad */
.screen.subject { max-width: 1000px; }
.tcard-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.tcard { min-width: 0; }
/* Monstre propre à la carte : image à fond transparent, pas de fondu « multiply » */
.tc-monster.own { mix-blend-mode: normal; width: 180px; height: 180px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.18)); }
.tcard.mini .tc-monster.own { width: 104px; height: 104px; }
.tcard.r0 .tc-monster.own { opacity: 1; }

/* Maths : énoncés longs, opérations posées, touche virgule */
.prompt.long { font-family: var(--body); font-weight: 800; font-size: 22px; line-height: 1.4; text-align: left; }
.prompt.posed { font-family: 'Courier New', ui-monospace, monospace; font-weight: 700; font-size: 40px; white-space: pre; text-align: right; line-height: 1.15; margin: 0 auto; width: max-content; }
.keypad .ok.wide { grid-column: 1 / -1; }
.prompt.posed { border-bottom: 3px solid var(--ink); padding: 0 6px 6px; margin-bottom: 4px; }
.choices.ops .btn.choice { font-size: 38px; padding: 10px 0; }

/* ---------- Dessins des questions de maths ---------- */
.visual { display: flex; justify-content: center; margin: 6px 0 10px; overflow-x: auto; }
.vstack { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.vgallery { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.vgallery figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vgallery figure svg { max-width: 150px; height: auto; }
.vgallery figcaption { font-family: var(--display); font-size: 24px; color: var(--ink); }
.vtable { border-collapse: collapse; font-weight: 800; font-size: 16px; }
.vtable th, .vtable td { border: 2px solid #1b2347; padding: 6px 10px; text-align: center; }
.vtable thead th { background: #fff3dc; }
.vtable tbody th { background: #eaf2ff; text-align: left; }
.vmoney { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; max-width: 420px; }
.vmoney .coin { width: 54px; height: 54px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; border: 3px solid rgba(0, 0, 0, 0.25); }
.vmoney .coin.copper { background: #e0965e; color: #4a2200; width: 44px; height: 44px; }
.vmoney .coin.gold { background: #f2cf4a; color: #4a3600; }
.vmoney .coin.euro { background: radial-gradient(circle, #f2cf4a 0 45%, #c9ced8 46%); color: #2a2a2a; width: 60px; height: 60px; }
.vmoney .bill { min-width: 96px; height: 52px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; color: #1b2347; border: 2px solid rgba(0, 0, 0, 0.25); }
.vmoney .bill.b5 { background: #c9ced8; }
.vmoney .bill.b10 { background: #f2a7a7; }
.vmoney .bill.b20 { background: #9fc3f2; }
.vmoney .bill.b50 { background: #f7c27a; }

/* Anglais : emojis en grand */
.vemoji { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; font-size: 64px; line-height: 1.1; }
.vgallery .vemoji { font-size: 44px; }

/* Anglais : petits textes à lire */
.prompt-text.reading { font-size: 19px; line-height: 1.5; text-align: left; font-weight: 600; white-space: pre-line; max-width: 640px; margin: 0 auto; }

/* Code oublié */
.forgot-answer { font-size: 34px; font-weight: 800; min-height: 48px; min-width: 140px; text-align: center; background: #fff; border-radius: 14px; padding: 6px 16px; margin: 8px auto; }
.forgot-answer.shake { animation: shake 0.4s; }

/* Vraies photos (Questionner le monde) */
.vphoto { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.vphoto img { width: 100%; max-width: 260px; aspect-ratio: 1; object-fit: cover; border-radius: 18px; box-shadow: 0 4px 14px rgba(20, 30, 60, 0.15); background: #fff; }
.vphoto.n2 img { max-width: 200px; }
/* 3 ou 4 photos : toujours sur une seule ligne (l'ordre gauche-droite compte dans « Qui est à gauche de… ? »). */
.vphoto.n3, .vphoto.n4 { flex-wrap: nowrap; }
.vphoto.n3 img, .vphoto.n4 img { max-width: 150px; flex: 1 1 0; min-width: 0; }
.vgallery .vphoto img { max-width: 140px; }
.lesson-photos { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 10px 0; }
.lesson-photos figure { margin: 0; width: 160px; text-align: center; }
.lesson-photos img { width: 160px; height: 160px; object-fit: cover; border-radius: 16px; box-shadow: 0 4px 12px rgba(20, 30, 60, 0.15); }
.lesson-photos figcaption { font-size: 14px; margin-top: 4px; }

/* Leçon, style B « le monstre t'explique » : fond teinté de la rubrique, bulles de BD, exemples en étiquettes. */
.lesson-b { background: var(--rub-light, #dff3e6); min-height: 100vh; }
.lb-head { display: flex; align-items: center; gap: 12px; margin: 6px 2px 4px; }
.lb-monster { width: 112px; height: 112px; object-fit: contain; flex: none; filter: drop-shadow(0 6px 8px rgba(20, 30, 60, .18)); }
.lb-head .display { font-size: 30px; margin: 2px 0 4px; color: var(--ink); }
.lb-head .kicker { color: var(--rub-deep); }
.lb-bubble { position: relative; background: #fff; border-radius: 26px; padding: 16px 18px; margin: 18px 0 0; box-shadow: 0 4px 0 rgba(20, 30, 60, .08); }
.lb-bubble::before { content: ''; position: absolute; left: 34px; top: -13px; border: 14px solid transparent; border-bottom-color: #fff; border-top: 0; }
.lb-bubble p { font-size: 19px; line-height: 1.6; margin: 6px 0; font-weight: 400; }
.lb-bubble .lp-title h3 { color: var(--rub-deep); }
.lb-intro p { font-size: 19px; }
.lb-chips { list-style: none; padding: 0; margin: 10px 0 2px; display: flex; flex-wrap: wrap; gap: 8px; }
.lb-chips li { background: color-mix(in srgb, var(--rub-light) 55%, #fff); border: 2px solid color-mix(in srgb, var(--rub) 45%, #fff); border-radius: 18px; padding: 6px 14px; font-size: 19px; line-height: 1.45; font-weight: 400; white-space: pre-wrap; }
.lb-chips li mark.wc { font-weight: 700; }
.lb-think { position: relative; background: #fff7d6; border-radius: 28px; padding: 12px 16px; margin-top: 14px; font-size: 18px; line-height: 1.55; }
.lb-think-dots { position: absolute; left: 22px; top: -16px; width: 12px; height: 12px; border-radius: 50%; background: #fff7d6; box-shadow: -10px -10px 0 -3px #fff7d6; }
.lesson-b .sticky-cta { background: var(--rub-light); margin: 26px -16px 0; padding: 10px 16px calc(env(safe-area-inset-bottom) + 10px); bottom: 0; box-shadow: 0 -6px 14px rgba(20, 30, 60, .08); border-radius: 22px 22px 0 0; }
/* Lecture : la question, sous le texte, bien visible juste avant les réponses. */
.reading-ask { margin-top: 14px; }
.reading-ask .word-ask { background: #fff7d6; border-radius: 16px; padding: 10px 14px; font-size: 19px; font-weight: 700; }
/* Textes et phrases longues : police de lecture (Andika), pas de gras serré. */
.prompt-text.reading { font-family: var(--body); font-weight: 400; font-size: 20px; line-height: 1.65; letter-spacing: 0.1px; }
.prompt-text.long { font-family: var(--body); font-weight: 700; line-height: 1.5; }
.prompt-text.reading::first-line { font-weight: 700; font-size: 22px; }

/* Mode test parent */
.test-mode { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #fff7d6; border-radius: 16px; padding: 12px 14px; margin: 12px 0; }
.test-mode p { margin: 4px 0 0; }
.test-badge { background: #ffc928; color: #5a3d00; border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: 14px; }

/* Écran « Mission accomplie » : ciel du soir, héros qui se repose, bilan du jour */
.timeup { background: linear-gradient(#2b3a8f, #5b6fd6 55%, #9fb4ff); color: #fff; min-height: 100vh; position: relative; overflow: hidden; padding: 30px 18px; gap: 10px; }
.timeup-sky { position: absolute; inset: 0; pointer-events: none; }
.timeup-sky .moon { position: absolute; top: 36px; right: 40px; width: 70px; height: 70px; border-radius: 50%; box-shadow: -16px 10px 0 0 #fff4c2; }
.timeup-sky i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .8; }
.timeup-sky i:nth-child(2) { top: 60px; left: 12%; } .timeup-sky i:nth-child(3) { top: 130px; left: 28%; width: 4px; height: 4px; }
.timeup-sky i:nth-child(4) { top: 40px; left: 55%; } .timeup-sky i:nth-child(5) { top: 170px; right: 18%; width: 4px; height: 4px; } .timeup-sky i:nth-child(6) { top: 220px; left: 8%; }
.timeup-hero { position: relative; margin-top: 60px; }
.zzz { position: absolute; top: -6px; right: -34px; font-family: var(--display); font-size: 34px; color: #fff4c2; }
.zzz small { font-size: 24px; margin-left: 2px; } .zzz small + small { font-size: 18px; }
.timeup-title { font-size: clamp(26px, 7vw, 38px); color: #fff; text-align: center; max-width: 520px; line-height: 1.1; }
.timeup-lead { font-size: 19px; text-align: center; max-width: 460px; margin: 4px 0; }
.timeup-stats { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.timeup-stats div { background: rgba(255, 255, 255, .18); border-radius: 18px; padding: 10px 14px; min-width: 104px; text-align: center; }
.timeup-stats strong { display: block; font-family: var(--display); font-size: 32px; font-weight: 400; }
.timeup-stats span { font-size: 14px; }
.timeup .btn.ghost { background: rgba(255, 255, 255, .9); margin-top: 8px; }

/* Page d'une matière : les sous-rubriques en grandes tuiles */
.rubric-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 10px; }
.rubric-tile { display: flex; flex-direction: column; align-items: stretch; gap: 10px; border: 0; cursor: pointer; text-align: left; background: var(--rub-light); border-radius: 26px; padding: 14px 16px 16px; box-shadow: 0 6px 0 color-mix(in srgb, var(--rub) 55%, #fff); font: inherit; color: var(--ink); }
.rubric-tile:active { transform: translateY(3px); box-shadow: 0 3px 0 color-mix(in srgb, var(--rub) 55%, #fff); }
.rt-pics { display: flex; justify-content: center; gap: 2px; height: 104px; }
.rt-pics img { width: 104px; height: 104px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(20, 30, 60, .15)); }
.rt-pics img + img { margin-left: -26px; }
.rt-text strong { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--rub-deep); }
.rt-text span { font-size: 16px; }
/* Rangée des cartes de la rubrique en mini : gagnées dans leur vrai cadre, à gagner en gris. */
.rt-minis { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.rt-mini { position: relative; width: 30px; aspect-ratio: 1024 / 1536; background: center / 100% 100% no-repeat; border-radius: 4px; filter: drop-shadow(0 2px 2px rgba(20, 30, 60, .25)); }
.rt-mini img { position: absolute; top: 6%; bottom: 32%; left: 11%; right: 11%; width: 78%; height: 62%; object-fit: contain; }
.rt-mini.leg img { top: 10%; left: 16%; width: 68%; height: 61%; }
.rt-mini.off { filter: grayscale(1) opacity(.45); }

/* Écran de question « quiz en duel » (essai) : fond aux couleurs de la rubrique, héroïne contre monstre */
.mission.quiz { background: radial-gradient(circle at 15% 8%, rgba(255,255,255,.14) 0 70px, transparent 71px), radial-gradient(circle at 90% 60%, rgba(255,255,255,.08) 0 120px, transparent 121px), linear-gradient(170deg, var(--quiz), var(--quiz-deep)); min-height: 100vh; color: #fff; }
.quiz-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quiz-level { font-weight: 700; font-size: 15px; opacity: .95; }
.quiz-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 4px; }
.qp { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.qp.right { flex-direction: row-reverse; text-align: right; }
.qp-face { width: 62px; height: 62px; border-radius: 50%; background: #fff; border: 3px solid #fff; overflow: hidden; flex: none; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0,0,0,.18); }
.qp-face.hero > * { transform: translateY(14px) scale(1.15); }
.qp-face.monster .monster { width: 58px !important; height: 58px !important; animation: none; }
.qp-face.monster.hurt { animation: shake .4s; }
.qp-info { min-width: 0; }
.qp-info strong { display: block; font-size: 14px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qp-hp { width: 100%; max-width: 110px; height: 10px; background: rgba(255,255,255,.28); border-radius: 99px; margin-top: 5px; overflow: hidden; }
.qp.right .qp-hp { margin-left: auto; }
.qp-hp i { display: block; height: 100%; background: #6cf09a; border-radius: 99px; transition: width .4s; }
.qp-hp.foe i { background: #ff6b8a; }
.qp-vs { font-family: var(--display); font-size: 22px; color: #ffd34d; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.quiz-pow { position: absolute; right: 70px; top: -6px; font-family: var(--display); font-size: 24px; color: #ffd34d; text-shadow: 0 2px 0 #9a6b00; animation: pop .6s; }
.quiz-num { text-align: center; color: #ffe27a; font-weight: 700; font-size: 15px; margin: 8px 0 6px; }
.mission.quiz .question-card { background: transparent; box-shadow: none; border: 0; padding: 0; color: #fff; display: flex; flex-direction: column; }
.mission.quiz .question-card > .visual, .mission.quiz .question-card > .sentence, .mission.quiz .question-card > .prompt-text, .mission.quiz .question-card > .prompt { order: 1; background: #fff; color: var(--ink); border-radius: 22px; border: 4px solid rgba(255,255,255,.85); padding: 14px; margin: 4px 0 14px; box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.mission.quiz .question-card > .visual { padding: 10px; }
.mission.quiz .question-card > .word-ask, .mission.quiz .question-card > .reading-ask { order: 2; justify-content: center; text-align: center; font-size: 22px; font-weight: 700; color: #fff; background: none; margin: 0 0 14px; }
.mission.quiz .question-card > .reading-ask .word-ask { background: none; color: #fff; justify-content: center; }
.mission.quiz .question-card > .listen { order: 1; }
.mission.quiz .question-card > .choices, .mission.quiz .question-card > .text-answer, .mission.quiz .question-card > .answer-display, .mission.quiz .question-card > .keypad { order: 3; }
.mission.quiz .question-card > .hint-btn, .mission.quiz .question-card > .bubble, .mission.quiz .question-card > .btn.big { order: 4; }
.mission.quiz .choices { grid-template-columns: 1fr 1fr; gap: 12px; }
.mission.quiz .choices.long { grid-template-columns: 1fr; }
.mission.quiz .btn.choice { background: linear-gradient(#fff, #eef0fb); color: #2b2f55; border-radius: 16px; padding: 16px 8px; font-size: 18px; box-shadow: 0 5px 0 rgba(20, 20, 60, .3); }
.mission.quiz .btn.choice.good { background: linear-gradient(#8ee36a, #5cc23f); color: #fff; box-shadow: 0 5px 0 #3f9128; }
.mission.quiz .btn.choice.bad { background: linear-gradient(#ff8a8a, #f05454); color: #fff; box-shadow: 0 5px 0 #b83232; }
.mission.quiz .bubble { color: var(--ink); }
.mission.quiz .hint-btn { background: rgba(255,255,255,.9); color: var(--ink); }
.mission.quiz .answer-display { background: #fff; color: var(--ink); border-radius: 16px; }
.mission.quiz .question-card > .sentence:empty { display: none; }
.mission.quiz .qp-info { flex: 1; }
.mission.quiz .question-card > .visual:has(.vphoto) { padding: 6px; }
.mission.quiz .visual .vphoto img { max-width: 100%; width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; box-shadow: none; }
.mission.quiz .visual .vphoto.n2 img, .mission.quiz .visual .vphoto.n3 img, .mission.quiz .visual .vphoto.n4 img { width: auto; max-width: 48%; aspect-ratio: 1; }
.quiz-top.solo { gap: 12px; justify-content: flex-start; }
.quiz-top.solo .qp-info { flex: 1; }
.qp-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.qp-line strong { font-size: 16px; }
.qp-line span { font-weight: 700; font-size: 15px; color: #ffe27a; }
.qp-hp.big { max-width: none; height: 16px; margin-top: 6px; box-shadow: inset 0 2px 4px rgba(0,0,0,.15); }
.qp-hp.big i { background: linear-gradient(90deg, #ffd34d, #6cf09a); }
.quiz-top.solo .quiz-pow { right: 6px; top: -10px; }

/* Étoile gagnée : la carte change de cadre sous les yeux de l'enfant */
.star-win { position: relative; width: 220px; margin: 6px auto 14px; }
.sw-card { position: relative; width: 220px; aspect-ratio: 2 / 3; }
.sw-art { position: absolute; left: 9%; right: 9%; top: 8%; height: 62%; width: 82%; object-fit: contain; z-index: 1; }
.sw-frame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.sw-frame.f-argent { filter: grayscale(1) brightness(1.45) contrast(1.1); }
.sw-frame.old { animation: swOut .5s ease-in 1.3s forwards; }
.sw-frame.new { opacity: 0; transform: scale(.6); animation: swIn .7s cubic-bezier(.2, 1.6, .4, 1) 1.5s forwards; filter: drop-shadow(0 0 18px rgba(255, 215, 80, .9)); }
.sw-name { position: absolute; left: 12%; right: 12%; bottom: 7%; height: 16%; display: grid; place-items: center; text-align: center; z-index: 3; font-family: var(--display); font-size: 15px; color: #3a2a10; line-height: 1.05; }
.sw-star { position: absolute; left: 50%; top: -60px; transform: translateX(-50%); font-size: 64px; color: #ffcf33; text-shadow: 0 0 18px rgba(255, 200, 40, .9); z-index: 4; animation: swStar 1.4s ease-in forwards; }
.sw-sparks i { position: absolute; left: 50%; top: 45%; width: 10px; height: 10px; border-radius: 50%; background: #ffd34d; opacity: 0; z-index: 5; animation: swSpark .9s ease-out 1.5s forwards; }
.sw-sparks i:nth-child(1) { --dx: -120px; --dy: -90px; } .sw-sparks i:nth-child(2) { --dx: 120px; --dy: -80px; } .sw-sparks i:nth-child(3) { --dx: -140px; --dy: 40px; }
.sw-sparks i:nth-child(4) { --dx: 140px; --dy: 50px; } .sw-sparks i:nth-child(5) { --dx: -60px; --dy: 150px; } .sw-sparks i:nth-child(6) { --dx: 70px; --dy: 150px; }
@keyframes swStar { 0% { top: -80px; transform: translateX(-50%) scale(1.4) rotate(0); } 80% { opacity: 1; } 100% { top: 40%; transform: translateX(-50%) scale(.3) rotate(360deg); opacity: 0; } }
@keyframes swOut { to { opacity: 0; transform: scale(1.08); } }
@keyframes swIn { to { opacity: 1; transform: scale(1); } }
@keyframes swSpark { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.4); } }
/* Fond de la carte selon la rareté (comme la maquette validée) */
.sw-bg { position: absolute; left: 6%; right: 6%; top: 5%; bottom: 22%; border-radius: 14px; z-index: 0; }
.sw-bg.old { animation: swOut .5s ease-in 1.3s forwards; }
.sw-bg.new { opacity: 0; animation: swIn .7s ease-out 1.5s forwards; }
.bg-commune { background: linear-gradient(#e9e9ea, #cfd0d3); }
.bg-bronze { background: radial-gradient(circle at 50% 35%, #3fb3a6, #135e5c); }
.bg-argent { background: radial-gradient(circle at 30% 20%, #fff 0 2px, transparent 3px) 0 0 / 34px 34px, radial-gradient(circle at 70% 60%, #fff 0 1.5px, transparent 2.5px) 0 0 / 46px 46px, radial-gradient(circle at 50% 30%, #3d5bd6, #141f5c); }
.bg-or { background: repeating-conic-gradient(from 0deg at 50% 30%, rgba(255,255,255,.25) 0 6deg, transparent 6deg 18deg), radial-gradient(circle at 50% 30%, #ffe27a, #c97a00); }
.bg-legendaire { background: linear-gradient(135deg, #ff9ad5, #ffd36b, #8ff0c0, #8fc8ff, #c9a2ff); }
.sw-name.n-bronze, .sw-name.n-argent, .sw-name.n-or, .sw-name.n-legendaire { color: #2b1a05; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
/* Fenêtre exacte de chaque cadre (mesurée sur les images) : fond, personnage et nom tombent pile dedans. */
.sw-card .w-commune { top: 3.6%; bottom: 16.1%; left: 4.7%; right: 4.9%; }
.sw-card .w-bronze, .sw-card .w-argent { top: 4%; bottom: 16.1%; left: 5.5%; right: 5.7%; }
.sw-card .w-or { top: 6.5%; bottom: 15.5%; left: 8.1%; right: 8.2%; }
.sw-card .w-legendaire { top: 17.6%; bottom: 20.2%; left: 13.2%; right: 13.3%; }
.sw-bg { border-radius: 10px; }
.sw-art { position: absolute; width: auto; height: auto; object-fit: contain; padding: 4%; box-sizing: border-box; }
.sw-name { left: 10%; right: 10%; height: auto; }
.sw-card .p-commune, .sw-card .p-bronze, .sw-card .p-argent { top: 85.5%; bottom: 2%; }
.sw-card .p-or { top: 86%; bottom: 2.5%; }
.sw-card .p-legendaire { top: 82%; bottom: 3%; }
.sw-artbox { position: absolute; z-index: 1; padding: 5%; box-sizing: border-box; }
.sw-artbox .sw-art { position: static; display: block; width: 100%; height: 100%; padding: 0; object-fit: contain; }

/* Carte gagnée : mêmes cadres et mêmes emplacements que l'animation validée (test-etoiles.html). */
.sw-card { width: 230px; aspect-ratio: 1024 / 1536; }
.sw-card .sw-frame { filter: none; }
.sw-card .sw-frame.new { filter: none; }
.sw-slot-art { position: absolute; display: grid; place-items: center; z-index: 2; }
.sw-slot-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .25)); }
.sw-slot-title { position: absolute; display: grid; place-items: center; text-align: center; z-index: 3; font-family: var(--display); font-size: 15px; line-height: 1.05; color: #3b2508; padding: 0 9%; }
.sw-slot-stars { position: absolute; display: flex; justify-content: center; align-items: center; gap: 4px; z-index: 3; font-size: 22px; color: #ffcf33; text-shadow: 0 0 6px rgba(255, 200, 40, .8), 0 2px 0 #9a6b00; }
.sw-slot-stars .new { opacity: 0; transform: scale(3); animation: swStarPop .5s ease-out 2.1s forwards; }
@keyframes swStarPop { to { opacity: 1; transform: scale(1); } }
.f-commune .sw-slot-art, .f-bronze .sw-slot-art, .f-argent .sw-slot-art, .f-or .sw-slot-art { top: 6%; bottom: 32%; left: 11%; right: 11%; }
.f-legendaire .sw-slot-art { top: 10%; bottom: 29%; left: 16%; right: 16%; }
.f-commune .sw-slot-title, .f-bronze .sw-slot-title, .f-argent .sw-slot-title, .f-or .sw-slot-title { top: 69%; bottom: 17%; left: 8%; right: 8%; }
.f-legendaire .sw-slot-title { top: 72%; bottom: 15%; left: 14%; right: 14%; }
.f-commune .sw-slot-stars, .f-bronze .sw-slot-stars, .f-argent .sw-slot-stars { top: 86%; bottom: 4%; left: 10%; right: 10%; }
.f-or .sw-slot-stars { top: 84%; bottom: 7%; left: 10%; right: 10%; }
.f-legendaire .sw-slot-stars { top: 87%; bottom: 5%; left: 14%; right: 14%; }

/* ===== Écran d'ouverture et bienvenue (fond violet nuit, illustrations 3D) ===== */
.welcome { position: fixed; inset: 0; z-index: 50; overflow: hidden; color: #fff; display: flex; justify-content: center;
  background: radial-gradient(circle at 50% 36%, #2f1a78, #1e0f4a 58%, #140935); }
.wl-conf i { position: absolute; width: 8px; height: 13px; border-radius: 2px; opacity: .9; transform: rotate(var(--rot)) scale(var(--sc)); animation: wlConf 5s ease-in-out infinite; }
@keyframes wlConf { 50% { transform: translateY(14px) rotate(calc(var(--rot) + 40deg)) scale(var(--sc)); } }
.wl-col { position: relative; width: 100%; max-width: 460px; height: 100%; display: flex; flex-direction: column; align-items: center; padding: max(22px, env(safe-area-inset-top)) 26px max(26px, env(safe-area-inset-bottom)); animation: wlIn .35s ease-out; }
@keyframes wlIn { from { opacity: 0; transform: translateY(12px); } }
.wl-logo { width: 100%; max-width: 380px; margin-top: 3vh; animation: wlPop .7s cubic-bezier(.2, 1.6, .4, 1) both; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35)); }
@keyframes wlPop { from { opacity: 0; transform: scale(.4); } }
.wl-art { position: relative; flex: 1 1 0; min-height: 0; width: 100%; display: grid; place-items: center; }
.wl-art.tall { margin-top: 34px; }
.wl-ill { max-width: 112%; max-height: 100%; object-fit: contain; }
.wl-ill.float { animation: wlFloat 3.2s ease-in-out infinite; }
@keyframes wlFloat { 50% { transform: translateY(-10px); } }
.wl-monster { position: absolute; right: 4%; bottom: 14%; width: 32%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .4)); animation: wlPop .6s cubic-bezier(.2, 1.6, .4, 1) .25s both; }
.wl-tag { margin: 0 0 18px; text-align: center; font-size: 19px; line-height: 1.35; font-weight: 700; }
.wl-title { margin: 6px 0 8px; text-align: center; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; }
.wl-title b { font-weight: 400; color: #ffcf33; }
.wl-text { margin: 0 0 16px; text-align: center; font-size: 17px; line-height: 1.4; color: #d9cfff; min-height: 4.2em; }
.wl-dots { display: flex; gap: 7px; margin-bottom: 18px; }
.wl-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .25); transition: all .25s; }
.wl-dots i.on { width: 22px; border-radius: 5px; background: #ffcf33; }
.wl-btn { width: 100%; height: 58px; border: 0; border-radius: 20px; cursor: pointer; font-family: var(--display); font-size: 24px; color: #fff; background: linear-gradient(#b05cff, #7a2cf0); box-shadow: 0 6px 0 #4d16a8, 0 12px 24px rgba(140, 60, 255, .45); }
.wl-btn.gold { color: #2a1a5e; background: linear-gradient(#ffe066, #ffb81f); box-shadow: 0 6px 0 #c58f00, 0 12px 24px rgba(255, 190, 40, .35); }
.wl-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #4d16a8; }
.wl-btn.gold:active { box-shadow: 0 2px 0 #c58f00; }
.wl-btn.bounce { animation: wlBounce 1.5s ease-in-out 1s infinite; }
@keyframes wlBounce { 50% { transform: translateY(-5px); } }
.wl-skip { position: absolute; right: 20px; top: max(16px, env(safe-area-inset-top)); z-index: 2; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 16px; color: #cbbcff; padding: 8px; }
.wl-fan { position: relative; height: 100%; max-height: 300px; aspect-ratio: 1.1; }
.wl-card { position: absolute; aspect-ratio: 1024 / 1536; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .5)); animation: wlPop .5s cubic-bezier(.2, 1.5, .4, 1) both; }
.wl-card > .fr { position: absolute; inset: 0; width: 100%; height: 100%; }
.wl-card .art { position: absolute; top: 6%; bottom: 32%; left: 11%; right: 11%; }
.wl-card.leg .art { top: 10%; bottom: 29%; left: 16%; right: 16%; }
.wl-card .art img { width: 100%; height: 100%; object-fit: contain; }
.wl-card.c1 { height: 68%; left: 0; top: 18%; rotate: -16deg; animation-delay: .05s; }
.wl-card.c2 { height: 72%; left: 17%; top: 6%; rotate: -7deg; animation-delay: .15s; }
.wl-card.c3 { height: 68%; right: 0; top: 18%; rotate: 14deg; animation-delay: .25s; }
.wl-card.c4 { height: 90%; left: 50%; top: 6%; translate: -50% 0; rotate: 2deg; animation-delay: .4s; }
@media (prefers-reduced-motion: reduce) { .welcome * { animation: none !important; } }

/* Inscription parent : même univers violet nuit que l'ouverture. */
body:has(.setup-night) { background: radial-gradient(circle at 50% 0, #2f1a78, #1e0f4a 60%, #140935) fixed; }
.setup-night .parent-hero { align-items: center; text-align: center; color: #fff; }
.setup-night .parent-hero .display { color: #fff; }
.setup-night .parent-hero p { color: #d9cfff; }
.setup-logo { width: 240px; max-width: 70%; }

/* ===== Thème « nuit » : accueil, matières, étoile gagnée, album (même univers que l'ouverture) ===== */
body:has(.screen.night) { background: radial-gradient(circle at 50% 0, #2f1a78, #1e0f4a 60%, #140935) fixed; }
.screen.night { color: #fff; }
.screen.night .section-title { color: #fff; }
.screen.night :focus-visible { outline-color: #ffcf33; }

.nt-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.nt-back { width: 42px; height: 42px; flex: none; border-radius: 14px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 20px; }
.nt-title { flex: 1; min-width: 0; margin: 0 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-pill { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 9px; border-radius: 18px; background: rgba(255, 255, 255, .12); border: 1.5px solid rgba(255, 255, 255, .18); font-family: var(--display); font-size: 17px; white-space: nowrap; }
.nt-star { color: #ffcf33; font-size: 20px; line-height: 1; text-shadow: 0 0 8px rgba(255, 200, 40, .8); }
.nt-pill.time { margin-left: auto; padding: 0 12px; font-size: 15px; color: #b9ffe2; }
.nt-pill.test { margin-left: auto; padding: 0 12px; font-size: 14px; background: #ffc928; color: #5a3d00; border-color: transparent; }
.nt-gear { width: 38px; height: 38px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 18px; }

/* Accueil */
.nt-hero { position: relative; display: flex; align-items: center; gap: 14px; margin: 4px 0 6px; }
.nt-avatar { position: relative; flex: none; padding: 0 12px 14px; }
.nt-avatar::before { content: ""; position: absolute; left: -6px; right: -6px; top: 6%; bottom: 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 207, 51, .4), transparent); }
.nt-avatar::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 2px; height: 26px; border-radius: 50%; background: linear-gradient(#b05cff, #6a2ce0); box-shadow: 0 5px 0 #4316a0, 0 0 18px rgba(170, 90, 255, .7); }
.nt-avatar .avatar { position: relative; z-index: 1; }
.nt-info { flex: 1; min-width: 0; }
.nt-name { margin: 0; font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1; }
.nt-rank { display: inline-block; margin-top: 7px; padding: 2px 12px; border-radius: 10px; background: linear-gradient(#ffe066, #ffb81f); color: #2a1a5e; font-family: var(--display); font-size: 15px; }
.nt-xp { height: 11px; border-radius: 6px; background: rgba(255, 255, 255, .16); margin-top: 9px; overflow: hidden; }
.nt-xp i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #ffcf33, #ff9f1f); }
.nt-sub { font-size: 14px; color: #cbbcff; margin-top: 4px; }
.nt-acts { display: flex; gap: 8px; margin-top: 10px; }
.nt-acts button { flex: 1; height: 40px; border-radius: 14px; font-family: var(--display); font-size: 17px; color: #fff; background: linear-gradient(#b05cff, #7a2cf0); box-shadow: 0 4px 0 #4d16a8; }
.nt-acts button:active { transform: translateY(3px); box-shadow: 0 1px 0 #4d16a8; }
.nt-sect { font-family: var(--display); font-weight: 400; font-size: 20px; margin: 12px 4px 8px; }
.nt-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 11px; }
.nt-subj { position: relative; height: 96px; border-radius: 22px; padding: 13px 16px; overflow: hidden; text-align: left; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--subject) 82%, #fff), color-mix(in srgb, var(--subject) 78%, #000));
  box-shadow: 0 6px 0 rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .3); }
.nt-subj:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .3); }
.nt-subj::before { content: ""; position: absolute; right: -30px; top: -46px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.nt-subj b { position: relative; display: block; font-family: var(--display); font-weight: 400; font-size: 23px; white-space: nowrap; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.nt-pb { position: relative; display: block; width: 44%; max-width: 150px; height: 9px; border-radius: 5px; background: rgba(0, 0, 0, .22); margin-top: 9px; overflow: hidden; }
.nt-pb i { display: block; height: 100%; background: #ffe066; border-radius: 5px; }
.nt-subj small { position: relative; display: block; font-size: 14px; font-weight: 700; margin-top: 4px; white-space: nowrap; }
.nt-faces { position: absolute; right: 8px; bottom: 2px; display: flex; }
.nt-faces img { width: 66px; height: 66px; object-fit: contain; margin-left: -20px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .3)); }

/* Rubriques */
.nt-rubrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.nt-rub { display: block; width: 100%; text-align: left; color: #fff; border-radius: 20px; padding: 9px 13px 11px; border: 1.5px solid rgba(255, 255, 255, .14);
  background: linear-gradient(135deg, color-mix(in srgb, var(--rub) 34%, transparent), rgba(255, 255, 255, .06)); }
.nt-rub:active { transform: translateY(3px); }
.nt-rub-head { display: flex; align-items: center; gap: 10px; }
.nt-rub-head img { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); }
.nt-rub-head b { flex: 1; font-family: var(--display); font-weight: 400; font-size: 23px; }
.nt-rub-head em { font-style: normal; font-family: var(--display); font-size: 16px; color: #ffcf33; }
.nt-minis { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.nt-mini { width: 21px; }
.nt-mini.off { filter: grayscale(1) brightness(.75) opacity(.5); }

/* Carte dans son vrai cadre (emplacements mesurés sur chaque cadre) */
.fcard { position: relative; display: block; width: 100%; aspect-ratio: 1024 / 1536; container-type: inline-size; }
.fc-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.fc-art { position: absolute; display: grid; place-items: center; top: 6%; bottom: 32%; left: 11%; right: 11%; }
.fc-art img { width: 100%; height: 100%; object-fit: contain; }
.fc-title { position: absolute; display: grid; place-items: center; text-align: center; top: 69%; bottom: 17%; left: 8%; right: 8%; padding: 0 5%; font-family: var(--display); font-size: 7.6cqw; line-height: 1.05; color: #3b2508; overflow: hidden; }
.fc-stars { position: absolute; display: flex; justify-content: center; align-items: center; top: 86%; bottom: 4%; left: 10%; right: 10%; font-size: 10cqw; letter-spacing: .5cqw; color: #ffcf33; text-shadow: 0 0 4px rgba(255, 200, 40, .8), 0 1px 0 #9a6b00; }
.fcard.f-or .fc-stars { top: 84%; bottom: 7%; }
.fcard.f-legendaire .fc-art { top: 10%; bottom: 29%; left: 16%; right: 16%; }
.fcard.f-legendaire .fc-title { top: 72%; bottom: 15%; left: 14%; right: 14%; }
.fcard.f-legendaire .fc-stars { top: 87%; bottom: 5%; left: 14%; right: 14%; }

/* Liste des cartes d'une rubrique, sur fond nuit */
.screen.subject.night .rubric > .section-title { display: none; }

/* Fin de partie et étoile gagnée */
.mission-end.night { display: flex; align-items: stretch; justify-content: center; }
.end-night { position: relative; width: 100%; max-width: 460px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 10px 6px; }
.en-rays { position: absolute; left: 50%; top: 190px; width: 760px; height: 760px; margin: -380px 0 0 -380px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(255, 215, 90, .17) 0 9deg, transparent 9deg 18deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 28%, transparent 76%); mask-image: radial-gradient(closest-side, #000 28%, transparent 76%); animation: enSpin 40s linear infinite; }
@keyframes enSpin { to { transform: rotate(360deg); } }
.end-night .star-win { position: relative; }
.end-night .sw-card { filter: drop-shadow(0 0 22px rgba(255, 215, 90, .7)); }
.en-title { position: relative; margin: 10px 0 0; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; }
.en-title b { font-weight: 400; color: #ffcf33; }
.en-lead { position: relative; margin: 0; font-size: 18px; line-height: 1.35; color: #d9cfff; }
.en-lead b { color: #fff; }
.en-hero { position: relative; }
.en-bar { width: 240px; max-width: 80%; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.en-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #ffcf33, #ff9f1f); }
.en-reward { position: relative; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 22px; background: rgba(255, 255, 255, .12); border: 1.5px solid rgba(255, 255, 255, .2); font-family: var(--display); font-size: 21px; white-space: nowrap; }
.en-review { position: relative; background: rgba(255, 255, 255, .1); color: #fff; }
.en-actions { position: relative; width: 100%; display: flex; flex-direction: column; gap: 14px; margin-top: 10px; padding: 0 14px; }
.wl-btn.ghost { background: rgba(255, 255, 255, .12); box-shadow: 0 6px 0 rgba(0, 0, 0, .25); font-size: 20px; height: 50px; }

/* Album : le classeur */
.al-count { margin: -4px 4px 10px; font-size: 16px; color: #d9cfff; }
.al-count b { font-family: var(--display); font-weight: 400; font-size: 22px; color: #ffcf33; }
.al-binder { position: relative; padding-right: 34px; }
.al-page { position: relative; background: #fbf6ea; color: #2a1a5e; border-radius: 8px 18px 18px 8px; padding: 14px 14px 16px 30px; min-height: 420px;
  box-shadow: inset 16px 0 20px -12px rgba(0, 0, 0, .35), 0 10px 22px rgba(0, 0, 0, .45); animation: wlIn .3s ease-out; }
.al-rings { position: absolute; left: 6px; top: 46px; bottom: 46px; width: 15px; display: flex; flex-direction: column; justify-content: space-around; }
.al-rings i { height: 15px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #9aa3b5 60%, #5c6476); }
.al-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.al-head b { font-family: var(--display); font-weight: 400; font-size: 24px; }
.al-head span { font-weight: 700; font-size: 15px; color: #6a5a3a; white-space: nowrap; }
.al-sleeves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.al-sleeve { position: relative; aspect-ratio: 1024 / 1536; padding: 3px; border-radius: 9px; background: rgba(200, 190, 170, .25); box-shadow: inset 0 0 0 1px rgba(120, 100, 70, .25); }
.al-sleeve::after { content: ""; position: absolute; inset: 0; border-radius: 9px; pointer-events: none; background: linear-gradient(135deg, rgba(255, 255, 255, .45), transparent 35%, transparent 70%, rgba(255, 255, 255, .2)); }
.al-sleeve.empty { display: grid; place-items: center; }
.al-sleeve.empty img { width: 70%; filter: grayscale(1) brightness(1.6) opacity(.25); }
.al-sleeve.empty em { position: absolute; bottom: 6%; left: 0; right: 0; text-align: center; font-style: normal; font-weight: 700; font-size: 12px; color: #a89b80; }
.al-tabs { position: absolute; right: 0; top: 34px; display: flex; flex-direction: column; gap: 7px; }
.al-tabs button { width: 34px; height: 86px; border-radius: 0 12px 12px 0; display: grid; place-items: center; color: #fff; font-family: var(--display); font-size: 14px; writing-mode: vertical-rl; background: var(--subject); box-shadow: 2px 3px 4px rgba(0, 0, 0, .3); opacity: .7; }
.al-tabs button.on { opacity: 1; width: 38px; margin-right: -4px; }
.al-pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; font-weight: 700; font-size: 17px; }
.al-pager button { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; font-size: 24px; line-height: 1; }

.nt-gem { display: inline-block; width: 14px; height: 14px; margin: 0 3px; flex: none; transform: rotate(45deg); border-radius: 3px; background: linear-gradient(135deg, #7df3ff, #3d8bff 60%, #8a5cff); box-shadow: 0 0 8px rgba(90, 200, 255, .8); }
.nt-subj b.long { font-size: 19px; }
.fc-title { font-size: 8.2cqw; }
