:root {
  --mp-blue:#009CEA;
  --mp-green:#7CBB00;
  --mp-orange:#D66B07;
  --mp-yellow:#F8D95C;
  --mp-purple:#6D5DFB;
  --mp-dark:#243447;
  --mp-muted:#64748b;
  --mp-border:#e6edf4;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body.mp-cm1-vocab-page {
  margin: 0;
  background: #f6f8fb;
  color: var(--mp-dark);
  font-family: Arial, Helvetica, sans-serif;
  padding-bottom: 20px;
}

.mp-nav-wrap {
  max-width: 1120px;
  margin: 18px auto 16px;
  padding: 0 15px;
}

.mp-nav-wrap .navbar {
  margin: 0;
  min-height: 100px;
  background: #fff;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(15,23,42,.08);
}

.mp-nav-wrap .navbar-brand {
  height: auto;
  padding: 12px 15px;
}

.mp-nav-wrap .navbar-brand img {
  max-height: 78px;
  width: auto;
  display: block;
}

.mp-nav-wrap .navbar-nav {
  margin-top: 24px;
}

.mp-nav-wrap .navbar-nav > li > a {
  color: #fff !important;
  font-weight: 800;
  padding: 13px 18px;
  line-height: 20px;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(15,23,42,.14);
  margin: 0 5px;
  transition: all .15s ease;
}

.mp-nav-wrap .navbar-nav > li > a:hover,
.mp-nav-wrap .navbar-nav > li > a:focus {
  color: #fff !important;
  text-decoration: none;
  filter: brightness(.97);
  transform: translateY(-2px);
}

.mp-nav-wrap .navbar-toggle {
  margin-top: 30px;
  margin-right: 15px;
}

.mp-hero {
  margin: 26px auto 22px;
  padding: 38px 32px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(214,107,7,.16), transparent 34%),
    linear-gradient(135deg,#fff 0%,#fff7ea 100%);
  border: 1px solid rgba(214,107,7,.16);
  box-shadow: 0 14px 38px rgba(15,23,42,.10);
  display: grid;
  grid-template-columns: 92px minmax(0,1fr);
  gap: 24px;
  align-items: center;
}

.mp-hero-icon {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: var(--mp-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: #fff;
  box-shadow: 0 14px 28px rgba(214,107,7,.22);
}

.mp-eyebrow {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(214,107,7,.13);
  color: #954700;
  font-weight: 900;
  margin-bottom: 14px;
}

.mp-hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  line-height: 1.12;
  font-weight: 900;
  color: #1f2937;
}

.mp-hero p {
  font-size: 18px;
  line-height: 1.55;
  color: var(--mp-muted);
  max-width: 850px;
  margin: 0;
}

.mp-hero-level {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #fed7aa;
  box-shadow: 0 8px 18px rgba(15,23,42,.08);
  font-weight: 900;
  color: #653000;
}

.mp-hero-level img {
  height: 58px;
  width: auto;
  display: block;
}

.mp-actions {
  margin-top: 22px;
}

.mp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  min-height: 46px;
  padding: 13px 20px;
  border-radius: 14px;
  font-weight: 800;
  text-decoration: none !important;
  margin: 0 8px 10px 0;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

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

.mp-btn-primary {
  background: var(--mp-blue);
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(0,156,234,.22);
}

.mp-btn-secondary {
  background: #fff;
  color: var(--mp-dark) !important;
  border: 1px solid #d8e2eb;
}

.mp-btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.mp-quick-access {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 22px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff7ea, #eef8ff);
  border: 1px solid #fed7aa;
  box-shadow: 0 8px 20px rgba(15,23,42,.08);
}

.mp-quick-access strong,
.mp-quick-access span {
  display: block;
}

.mp-quick-access strong {
  color: #653000;
  font-size: 18px;
}

.mp-quick-access span {
  color: var(--mp-muted);
}

.mp-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 22px;
  align-items: start;
}

.mp-main-column,
.mp-side-column {
  min-width: 0;
}

.mp-card {
  background: #fff;
  border: 1px solid var(--mp-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 24px rgba(15,23,42,.07);
  margin-bottom: 22px;
  overflow-wrap: anywhere;
}

.mp-card h2,
.mp-card h3 {
  margin-top: 0;
  font-weight: 900;
}

.mp-card h2 {
  font-size: 29px;
}

.mp-card h3 {
  font-size: 22px;
  margin-top: 22px;
}

.mp-card p,
.mp-lesson-list,
.mp-correction-content {
  font-size: 17px;
  line-height: 1.75;
}

.mp-card p {
  color: var(--mp-muted);
}

.mp-objective-box,
.mp-example-card,
.mp-reminder {
  border-radius: 20px;
  padding: 16px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 17px;
  line-height: 1.7;
}

.mp-objective-box {
  border-left: 6px solid var(--mp-orange);
}

.mp-example-card {
  border-left: 6px solid var(--mp-blue);
  margin: 16px 0;
}

.mp-word-grid,
.mp-related-grid,
.mp-method-steps {
  display: grid;
  gap: 12px;
  margin: 16px 0 22px;
}

.mp-word-grid {
  grid-template-columns: repeat(3, minmax(0,1fr));
}

.mp-method-steps {
  grid-template-columns: repeat(4, minmax(0,1fr));
}

.mp-word-grid div,
.mp-method-steps div {
  min-width: 0;
  border: 1px solid #fed7aa;
  background: #fff7ea;
  border-radius: 18px;
  padding: 14px;
}

.mp-method-steps span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--mp-orange);
  color: #fff;
  font-weight: 900;
  margin-bottom: 8px;
}

.mp-word-grid strong,
.mp-method-steps strong {
  display: block;
  color: #653000;
  font-size: 18px;
}

.mp-word-grid span,
.mp-method-steps small {
  display: block;
  color: var(--mp-muted);
  margin-top: 5px;
  line-height: 1.55;
}

.mp-lesson-list {
  padding-left: 22px;
}

.mp-lesson-list li {
  margin-bottom: 8px;
}

.mp-reminder {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.mp-game-card {
  padding: 16px;
  background: #fff;
}

.mp-game-shell {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background:
    radial-gradient(circle at 20% 20%, rgba(0,156,234,.08) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(214,107,7,.10) 0 2px, transparent 3px),
    linear-gradient(135deg, #fffdf7, #f8fbff);
  background-size: 34px 34px, 42px 42px, auto;
}

.mp-game-topbar {
  min-height: 50px;
  background: linear-gradient(90deg, #4353ff, #6d5dfb);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  font-weight: 900;
}

.mp-game-topbar span + span::before {
  content: "•";
  margin-right: 10px;
  opacity: .85;
}

.mp-game-objective {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px;
  background: #ffe59a;
  color: #151515;
}

.mp-game-objective span {
  flex: 1 1 260px;
  font-size: 16px;
}

.mp-help-button {
  border: 0;
  background: #fff;
  color: #243447;
  font-weight: 900;
  border-radius: 999px;
  padding: 8px 12px;
  text-decoration: underline;
}

.mp-help-panel {
  margin: 14px 18px 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}

.mp-help-panel p {
  margin: 0;
  color: #0f3554;
  font-size: 15px;
}

.mp-game-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 230px;
  gap: 18px;
  padding: 18px;
}

.mp-play-board {
  min-width: 0;
  background: rgba(255,255,255,.95);
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 12px 28px rgba(15,23,42,.08);
}

.mp-step-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.mp-step-count,
.mp-score-pill,
.mp-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eadbff;
  color: #4b2785;
  font-weight: 900;
  padding: 8px 12px;
}

.mp-step-head h2 {
  font-size: 25px;
  line-height: 1.25;
  margin: 12px 0 0;
}

.mp-score-pill {
  background: #eaf8da;
  color: #355900;
  white-space: nowrap;
}

.mp-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  align-items: stretch;
  margin: 22px 0;
}

.mp-slot-wrap {
  min-width: 0;
  position: relative;
}

.mp-slot-label {
  text-align: center;
  font-weight: 900;
  font-size: 13px;
  color: #64748b;
  min-height: 18px;
  margin-bottom: 6px;
}

.mp-slot {
  min-height: 78px;
  border: 3px solid #f2b540;
  background: #fff4c8;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: all .15s ease;
}

.mp-slot::after {
  content: attr(data-index);
  position: absolute;
  top: 26px;
  left: 8px;
  font-size: 12px;
  color: rgba(0,0,0,.35);
  font-weight: 900;
}

.mp-slot.is-over,
.mp-slot.is-selected-target {
  border-color: var(--mp-blue);
  background: #eef8ff;
}

.mp-slot.is-correct {
  border-color: #22c55e;
  background: #f0fdf4;
}

.mp-slot.is-wrong {
  border-color: #ef4444;
  background: #fef2f2;
}

.mp-slot-wrap:not(:last-child)::after {
  content: "›";
  position: absolute;
  right: -12px;
  top: 43px;
  font-size: 32px;
  line-height: 1;
  color: #94a3b8;
  font-weight: 900;
}

.mp-bank-title {
  font-weight: 900;
  color: #0f3554;
  margin: 10px 0 8px;
}

.mp-label-bank {
  min-height: 82px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
}

.mp-label {
  border: 2px solid #cbd5e1;
  background: #fff;
  color: #1f2937;
  border-radius: 10px;
  padding: 12px 15px;
  min-width: 96px;
  text-align: center;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(15,23,42,.08);
  cursor: grab;
  touch-action: manipulation;
}

.mp-label:active {
  cursor: grabbing;
}

.mp-label.is-selected {
  outline: 4px solid rgba(0,156,234,.25);
  border-color: var(--mp-blue);
}

.mp-label.is-correct {
  border-color: #22c55e;
}

.mp-label.is-wrong {
  border-color: #ef4444;
}

.mp-game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mp-feedback {
  min-height: 44px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  font-weight: 900;
  display: none;
}

.mp-feedback.is-visible {
  display: block;
  background: #eef8ff;
  color: #0f3554;
  border: 1px solid #bfdbfe;
}

.mp-feedback.is-good {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.mp-feedback.is-bad {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.mp-game-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
}

.mp-mascot-card,
.mp-timer-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 10px 22px rgba(15,23,42,.07);
}

.mp-mascot-card img {
  max-width: 126px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 10px;
}

.mp-timer-card strong,
.mp-timer-card span {
  display: block;
}

.mp-timer-card strong {
  font-size: 18px;
  color: #653000;
}

.mp-timer-card span {
  margin-top: 5px;
  font-size: 25px;
  font-weight: 900;
  color: #1f2937;
}

.mp-progress {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #fff0b8;
  overflow: hidden;
  margin-top: 12px;
}

.mp-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--mp-blue), var(--mp-green));
}

.mp-small-link {
  display: block;
  text-align: center;
  color: #243447;
  font-weight: 900;
  text-decoration: underline;
}

.mp-correction-toggle {
  width: 100%;
  border: 0;
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(135deg, var(--mp-orange), #f59e0b);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.mp-correction-content {
  margin-top: 18px;
}

.mp-correction-content li {
  margin-bottom: 10px;
}

.mp-related-grid {
  grid-template-columns: repeat(3, minmax(0,1fr));
}

.mp-related-grid a {
  display: block;
  border-radius: 18px;
  border: 1px solid #fed7aa;
  background: #fff7ea;
  color: #653000;
  padding: 13px 14px;
  font-weight: 900;
  text-decoration: none !important;
}

.mp-related-grid a:hover {
  background: #ffefd2;
}

.mp-side-column {
  position: sticky;
  top: 18px;
}

.mp-tip-card {
  background: linear-gradient(135deg, #fff7ea, #ffffff);
}

.mp-mini-card p {
  margin-bottom: 8px;
}

@media (max-width: 991px) {
  .mp-layout,
  .mp-game-layout {
    grid-template-columns: 1fr;
  }

  .mp-side-column {
    position: static;
  }

  .mp-word-grid,
  .mp-related-grid,
  .mp-method-steps {
    grid-template-columns: 1fr;
  }

  .mp-game-side {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 767px) {
  .mp-nav-wrap {
    margin-top: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  .mp-nav-wrap .navbar {
    min-height: 0;
    border-radius: 0 0 18px 18px;
  }

  .mp-nav-wrap .navbar-brand img {
    max-height: 64px;
  }

  .mp-nav-wrap .navbar-nav {
    margin-top: 7.5px;
  }

  .mp-nav-wrap .navbar-nav > li > a {
    display: block;
    margin: 6px 0;
    text-align: center;
  }

  .mp-nav-wrap .navbar-toggle {
    margin-top: 24px;
  }

  .mp-hero {
    grid-template-columns: 1fr;
    padding: 24px 18px;
    border-radius: 24px;
  }

  .mp-hero-icon {
    width: 74px;
    height: 74px;
    font-size: 34px;
  }

  .mp-hero h1 {
    font-size: 31px;
  }

  .mp-hero-level,
  .mp-quick-access {
    width: 100%;
  }

  .mp-hero-level {
    justify-content: center;
  }

  .mp-quick-access {
    align-items: stretch;
    flex-direction: column;
  }

  .mp-card {
    padding: 18px;
    border-radius: 22px;
  }

  .mp-game-card {
    padding: 10px;
  }

  .mp-game-layout,
  .mp-play-board {
    padding: 12px;
  }

  .mp-game-side {
    grid-template-columns: 1fr;
  }

  .mp-card h2 {
    font-size: 25px;
  }

  .mp-actions,
  .mp-game-actions,
  .mp-step-head {
    flex-direction: column;
  }

  .mp-btn,
  .mp-score-pill {
    width: 100%;
  }

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

  .mp-slot-wrap::after {
    display: none;
  }

  .mp-label {
    min-width: 0;
    flex: 1 1 calc(50% - 10px);
    padding: 11px 10px;
  }
}

@media (max-width: 420px) {
  .mp-slots {
    grid-template-columns: 1fr;
  }

  .mp-label {
    flex-basis: 100%;
  }
}

/* Correctif Maprimaire : quiz vocabulaire CM1 compact */
.mp-game-card .mp-game-layout {
  grid-template-columns: minmax(0, 1fr) !important;
}

.mp-game-card .mp-game-side {
  display: none !important;
}

.mp-game-card .mp-play-board {
  width: 100%;
}

@media (max-width: 767px) {
  .mp-game-card .mp-game-layout {
    padding: 12px;
  }
}
