/* ============================================================
   MHF5P player — MHF brand stylesheet
   Scoped to .mhf5p-root (added by mhf5p-player.js render()).
   Design tokens mirror css/custom.css / the Tailwind mhf-* palette.
   Structural inline styles (computed positions, grid column counts,
   display toggles) stay in the JS; everything visual lives here.
   ============================================================ */

.mhf5p-root {
  /* --- Tokens --- */
  --mhf5p-accent:        #5a95f5;  /* mhf-accent / mhf-nav */
  --mhf5p-accent-dark:   #3a7ae4;  /* hover state */
  --mhf5p-accent-soft:   #eef5fe;  /* light accent tint (zones, flips) */
  --mhf5p-accent-soft-2: #d9e9fd;  /* stronger tint (drag-over) */
  --mhf5p-accent-border: #b7d2fb;  /* dashed drop-zone borders */
  --mhf5p-text:          #3c414e;  /* mhf-text */
  --mhf5p-body-text:     #4b5563;  /* secondary body copy */
  --mhf5p-muted:         #9ca3af;  /* mhf-muted */
  --mhf5p-bg:            #e3f0fe;  /* mhf-bg */
  --mhf5p-card:          #ffffff;  /* mhf-card */
  --mhf5p-orange:        #f5a623;  /* mhf-orange */
  --mhf5p-border:        #dbe3ef;  /* card / control borders */
  --mhf5p-success:       #22c55e;  /* matched / found feedback */
  --mhf5p-success-soft:  #bbf7d0;
  --mhf5p-radius-sm:     6px;
  --mhf5p-radius-md:     12px;
  --mhf5p-radius-lg:     20px;
  --mhf5p-radius-pill:   999px;
  --mhf5p-shadow-card:   0 2px 12px rgba(0, 0, 0, 0.08);

  font-family: 'Inter', sans-serif;
  color: var(--mhf5p-text);
}

.mhf5p-root .mhf5p-slide {
  margin-bottom: 1.25rem;
}

.mhf5p-root .mhf5p-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.mhf5p-root .mhf5p-body {
  font-size: 0.875rem;
  color: var(--mhf5p-body-text);
  line-height: 1.6;
}

.mhf5p-root .mhf5p-question {
  font-weight: 600;
  margin: 0 0 8px;
}

.mhf5p-root .mhf5p-hint {
  font-size: 0.72rem;
  color: var(--mhf5p-muted);
  margin: 6px 0 0;
}

.mhf5p-root .mhf5p-fillblank {
  font-size: 0.875rem;
  line-height: 2;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-next,
.mhf5p-root .mhf5p-continue {
  padding: 8px 20px;
  border: none;
  border-radius: var(--mhf5p-radius-pill);
  background: var(--mhf5p-accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}

.mhf5p-root .mhf5p-next:hover,
.mhf5p-root .mhf5p-continue:hover {
  background: var(--mhf5p-accent-dark);
}

.mhf5p-root .mhf5p-next:active,
.mhf5p-root .mhf5p-continue:active {
  transform: scale(0.97);
}

.mhf5p-root .mhf5p-continue {
  margin-top: 10px;
}

.mhf5p-root .mhf5p-prev,
.mhf5p-root .mhf5p-review {
  padding: 8px 20px;
  border: 1.5px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-pill);
  background: var(--mhf5p-card);
  color: var(--mhf5p-text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mhf5p-root .mhf5p-prev:hover,
.mhf5p-root .mhf5p-review:hover {
  border-color: var(--mhf5p-accent);
  background: var(--mhf5p-accent-soft);
}

/* ------------------------------------------------------------
   Wizard navigation & summary panel
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-progress {
  height: 8px;
  background: var(--mhf5p-bg);
  border-radius: var(--mhf5p-radius-pill);
  margin-bottom: 10px;
  overflow: hidden;
}

.mhf5p-root .mhf5p-progress-fill {
  height: 100%;
  background: var(--mhf5p-accent);
  border-radius: var(--mhf5p-radius-pill);
  transition: width 0.25s;
}

.mhf5p-root .mhf5p-wizard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.mhf5p-root .mhf5p-step-label {
  font-size: 0.78rem;
  color: var(--mhf5p-muted);
}

.mhf5p-root .mhf5p-wizard-summary {
  border: 1px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  padding: 16px;
  background: var(--mhf5p-card);
  box-shadow: var(--mhf5p-shadow-card);
}

.mhf5p-root .mhf5p-wizard-summary-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.mhf5p-root .mhf5p-wizard-summary-text {
  font-size: 0.85rem;
  color: var(--mhf5p-body-text);
  margin: 0 0 12px;
}

/* ------------------------------------------------------------
   Interactive video
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-video {
  position: relative;
  margin-bottom: 12px;
}

.mhf5p-root .mhf5p-video iframe,
.mhf5p-root .mhf5p-video video {
  border-radius: var(--mhf5p-radius-md);
  width: 100%;
  display: block;
}

.mhf5p-root .mhf5p-checkpoint {
  border: 1px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  padding: 12px;
  margin-bottom: 8px;
  background: var(--mhf5p-card);
}

.mhf5p-root .mhf5p-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  border-radius: var(--mhf5p-radius-md);
  padding: 16px;
  overflow-y: auto;
  z-index: 5;
}

.mhf5p-root .mhf5p-video-overlay-inner {
  background: var(--mhf5p-card);
  border-radius: var(--mhf5p-radius-md);
  padding: 14px;
  max-width: 520px;
  margin: 0 auto;
}

/* Checkpoint boxes shown inside the overlay don't need their own frame */
.mhf5p-root .mhf5p-video-overlay-inner .mhf5p-checkpoint {
  border: none;
  padding: 0;
  margin-bottom: 0;
}

/* ------------------------------------------------------------
   Choices (radio / checkbox / summary groups)
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.875rem;
  cursor: pointer;
}

.mhf5p-root .mhf5p-choice input {
  accent-color: var(--mhf5p-accent);
}

.mhf5p-root .mhf5p-summary-group {
  border: 1px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  padding: 10px;
  margin-bottom: 8px;
  background: var(--mhf5p-card);
}

.mhf5p-root .mhf5p-summary-group .mhf5p-choice {
  align-items: flex-start;
}

.mhf5p-root .mhf5p-summary-group .mhf5p-choice input {
  margin-top: 3px;
}

/* ------------------------------------------------------------
   Image choice
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mhf5p-root .mhf5p-image-choice {
  border: 1.5px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  padding: 8px;
  cursor: pointer;
  max-width: 140px;
  background: var(--mhf5p-card);
  font-size: 0.8rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mhf5p-root .mhf5p-image-choice:hover {
  border-color: var(--mhf5p-accent-border);
}

.mhf5p-root .mhf5p-image-choice:has(input:checked) {
  border-color: var(--mhf5p-accent);
  background: var(--mhf5p-accent-soft);
}

.mhf5p-root .mhf5p-image-choice input {
  margin-right: 6px;
  accent-color: var(--mhf5p-accent);
}

.mhf5p-root .mhf5p-image-choice img {
  display: block;
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--mhf5p-radius-sm);
  margin-bottom: 6px;
}

/* ------------------------------------------------------------
   Text inputs / selects / textareas
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-input,
.mhf5p-root .mhf5p-select,
.mhf5p-root .mhf5p-textarea,
.mhf5p-root .mhf5p-blank-input {
  border: 1.5px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-sm);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--mhf5p-text);
  background: var(--mhf5p-card);
}

.mhf5p-root .mhf5p-input:focus,
.mhf5p-root .mhf5p-select:focus,
.mhf5p-root .mhf5p-textarea:focus,
.mhf5p-root .mhf5p-blank-input:focus {
  outline: none;
  border-color: var(--mhf5p-accent);
}

.mhf5p-root .mhf5p-input {
  width: 100%;
}

.mhf5p-root .mhf5p-textarea {
  width: 100%;
  resize: vertical;
}

.mhf5p-root .mhf5p-blank-input {
  width: 120px;
  padding: 2px 8px;
  margin: 0 4px;
}

/* ------------------------------------------------------------
   Drag the words
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-dw-line {
  font-size: 0.9rem;
  line-height: 2.2;
  margin-bottom: 10px;
}

.mhf5p-root .mhf5p-dw-zone {
  display: inline-block;
  min-width: 90px;
  min-height: 26px;
  border: 1.5px dashed var(--mhf5p-accent-border);
  border-radius: var(--mhf5p-radius-sm);
  padding: 1px 8px;
  margin: 0 4px;
  vertical-align: middle;
  background: var(--mhf5p-accent-soft);
  text-align: center;
}

.mhf5p-root .mhf5p-dw-zone.is-dragover {
  background: var(--mhf5p-accent-soft-2);
}

.mhf5p-root .mhf5p-dw-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1.5px dashed var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  min-height: 42px;
}

.mhf5p-root .mhf5p-dw-word {
  padding: 4px 12px;
  background: var(--mhf5p-card);
  border: 1.5px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-pill);
  cursor: grab;
  font-size: 0.85rem;
}

/* ------------------------------------------------------------
   Mark the words
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-markwords {
  font-size: 0.95rem;
  line-height: 2;
}

.mhf5p-root .mhf5p-mw-token {
  border: 0;
  background: transparent;
  padding: 2px 4px;
  margin: 0 1px;
  border-radius: var(--mhf5p-radius-sm);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.mhf5p-root .mhf5p-mw-token:hover {
  background: var(--mhf5p-accent-soft);
}

.mhf5p-root .mhf5p-mw-token.is-selected {
  background: var(--mhf5p-accent-soft-2);
}

/* ------------------------------------------------------------
   Crossword
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-cw-grid {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.mhf5p-root .mhf5p-cw-cell {
  position: relative;
}

.mhf5p-root .mhf5p-cw-cell input {
  width: 28px;
  height: 28px;
  text-align: center;
  border: 1px solid var(--mhf5p-muted);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
  text-transform: uppercase;
  padding: 0;
  color: var(--mhf5p-text);
}

.mhf5p-root .mhf5p-cw-cell input:focus {
  outline: none;
  border-color: var(--mhf5p-accent);
}

.mhf5p-root .mhf5p-cw-num {
  position: absolute;
  top: -1px;
  left: 2px;
  font-size: 0.5rem;
  color: var(--mhf5p-muted);
  z-index: 2;
  pointer-events: none;
}

.mhf5p-root .mhf5p-cw-block {
  width: 28px;
  height: 28px;
  background: var(--mhf5p-text);
  border-radius: 4px;
}

.mhf5p-root .mhf5p-cw-clues {
  font-size: 0.8rem;
  color: var(--mhf5p-body-text);
  padding-left: 18px;
  display: grid;
  gap: 2px;
}

/* ------------------------------------------------------------
   Word search
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-ws-grid {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
  user-select: none;
}

.mhf5p-root .mhf5p-ws-cell {
  width: 26px;
  height: 26px;
  border: 1px solid var(--mhf5p-border);
  border-radius: 4px;
  background: var(--mhf5p-card);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mhf5p-text);
  cursor: pointer;
  padding: 0;
}

.mhf5p-root .mhf5p-ws-cell.is-anchor {
  background: var(--mhf5p-accent-soft-2);
}

.mhf5p-root .mhf5p-ws-cell.is-found {
  background: var(--mhf5p-success-soft);
  border-color: var(--mhf5p-success);
}

.mhf5p-root .mhf5p-ws-words {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mhf5p-body-text);
}

.mhf5p-root .mhf5p-ws-words .is-found {
  text-decoration: line-through;
  color: var(--mhf5p-success);
}

/* ------------------------------------------------------------
   Flashcards & dialog cards
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-flashcards {
  display: grid;
  gap: 10px;
}

.mhf5p-root .mhf5p-flashcard {
  border: 1px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  padding: 12px;
  display: grid;
  gap: 8px;
  background: var(--mhf5p-card);
  box-shadow: var(--mhf5p-shadow-card);
}

.mhf5p-root .mhf5p-flashcard img {
  max-width: 200px;
  border-radius: var(--mhf5p-radius-sm);
}

.mhf5p-root .mhf5p-flashcard .mhf5p-input {
  max-width: 260px;
  padding: 4px 10px;
  font-size: 0.85rem;
}

.mhf5p-root .mhf5p-card-front {
  font-size: 0.9rem;
  font-weight: 600;
}

.mhf5p-root .mhf5p-card-back {
  font-size: 0.9rem;
}

.mhf5p-root .mhf5p-card-hint {
  font-size: 0.72rem;
  color: var(--mhf5p-muted);
  margin-top: 8px;
}

.mhf5p-root .mhf5p-dialogcards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mhf5p-root .mhf5p-dialogcard {
  border: 1px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  padding: 14px;
  min-width: 200px;
  max-width: 260px;
  background: var(--mhf5p-card);
  box-shadow: var(--mhf5p-shadow-card);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.15s ease;
}

.mhf5p-root .mhf5p-dialogcard.is-flipped {
  background: var(--mhf5p-accent-soft);
}

.mhf5p-root .mhf5p-dialogcard img {
  max-width: 100%;
  border-radius: var(--mhf5p-radius-sm);
  margin-bottom: 8px;
}

/* ------------------------------------------------------------
   Memory game
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  max-width: 520px;
}

.mhf5p-root .mhf5p-memory-tile {
  min-height: 70px;
  border: 1.5px solid var(--mhf5p-accent);
  border-radius: var(--mhf5p-radius-md);
  background: var(--mhf5p-accent);
  color: #fff;
  cursor: pointer;
  padding: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.mhf5p-root .mhf5p-memory-tile.is-revealed {
  background: var(--mhf5p-card);
  color: var(--mhf5p-text);
  border-color: var(--mhf5p-border);
  font-weight: 400;
}

.mhf5p-root .mhf5p-memory-tile.is-matched {
  border-color: var(--mhf5p-success);
}

.mhf5p-root .mhf5p-memory-tile img {
  max-width: 100%;
  max-height: 52px;
  border-radius: var(--mhf5p-radius-sm);
  display: block;
  margin: 0 auto 4px;
}

/* ------------------------------------------------------------
   Image pairing
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-imagepairing {
  display: grid;
  gap: 8px;
}

.mhf5p-root .mhf5p-ip-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.mhf5p-root .mhf5p-ip-left {
  border: 1px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  padding: 8px;
  background: var(--mhf5p-bg);
}

.mhf5p-root .mhf5p-ip-zone {
  border: 1.5px dashed var(--mhf5p-accent-border);
  border-radius: var(--mhf5p-radius-md);
  padding: 8px;
  min-height: 44px;
  background: var(--mhf5p-accent-soft);
}

.mhf5p-root .mhf5p-ip-zone.is-dragover {
  background: var(--mhf5p-accent-soft-2);
}

.mhf5p-root .mhf5p-ip-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1.5px dashed var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  min-height: 52px;
}

.mhf5p-root .mhf5p-ip-chip {
  padding: 6px 10px;
  background: var(--mhf5p-card);
  border: 1.5px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  cursor: grab;
}

.mhf5p-root .mhf5p-ip-img {
  max-width: 80px;
  max-height: 52px;
  border-radius: var(--mhf5p-radius-sm);
  display: block;
  margin-bottom: 2px;
}

.mhf5p-root .mhf5p-ip-label {
  font-size: 0.82rem;
}

/* ------------------------------------------------------------
   Image sequencing
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-seq-list {
  display: grid;
  gap: 6px;
  max-width: 420px;
}

.mhf5p-root .mhf5p-seq-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  padding: 6px 10px;
  background: var(--mhf5p-card);
}

.mhf5p-root .mhf5p-seq-item img {
  width: 54px;
  height: 38px;
  object-fit: cover;
  border-radius: var(--mhf5p-radius-sm);
}

.mhf5p-root .mhf5p-seq-label {
  flex: 1;
  font-size: 0.85rem;
}

.mhf5p-root .mhf5p-seq-move {
  border: 1.5px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-sm);
  background: var(--mhf5p-card);
  color: var(--mhf5p-text);
  cursor: pointer;
  padding: 2px 8px;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mhf5p-root .mhf5p-seq-move:hover {
  border-color: var(--mhf5p-accent);
  background: var(--mhf5p-accent-soft);
}

/* ------------------------------------------------------------
   Drag & drop buckets
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-drag-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1.5px dashed var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  min-height: 48px;
}

.mhf5p-root .mhf5p-drag-pool.is-dragover {
  background: var(--mhf5p-accent-soft);
}

.mhf5p-root .mhf5p-drop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.mhf5p-root .mhf5p-drop-zone {
  border: 1px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-md);
  padding: 8px;
  min-height: 80px;
  background: var(--mhf5p-bg);
}

.mhf5p-root .mhf5p-drop-zone.is-dragover {
  background: var(--mhf5p-accent-soft-2);
}

.mhf5p-root .mhf5p-drop-label {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.mhf5p-root .mhf5p-drag-item {
  padding: 6px 10px;
  background: var(--mhf5p-card);
  border: 1.5px solid var(--mhf5p-border);
  border-radius: var(--mhf5p-radius-sm);
  cursor: grab;
  font-size: 0.85rem;
}

/* ------------------------------------------------------------
   Hotspot
   ------------------------------------------------------------ */
.mhf5p-root .mhf5p-hotspot-frame {
  position: relative;
  max-width: 100%;
  display: inline-block;
}

.mhf5p-root .mhf5p-hotspot-frame > img {
  max-width: 100%;
  display: block;
  border-radius: var(--mhf5p-radius-md);
}

.mhf5p-root .mhf5p-hotspot-region {
  position: absolute;
  border: 2px solid rgba(90, 149, 245, 0.8);
  background: rgba(90, 149, 245, 0.15);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}

.mhf5p-root .mhf5p-hotspot-region.is-selected {
  border-color: rgba(245, 166, 35, 0.9);
  background: rgba(245, 166, 35, 0.35);
}
