/* Disable text selection across the entire game */
html, body, * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Side-button layout for translated labels — smaller font to prevent overflow */
body.lang-translated .side-button {
  word-break: break-word;
  overflow-wrap: break-word;
  text-align: center;
  font-size: 0.62rem;
  line-height: 1.1;
}

@keyframes submitPulsate {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.5);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 12px 4px rgba(13, 148, 136, 0.35);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0);
  }
}

#submit-button.submit-pulsate {
  animation: submitPulsate 1.2s ease-in-out infinite;
}

body.level2-tour-step10-hide-done .driver-popover-done-btn {
  display: none !important;
}

body.level2-tour-step10-hide-done .driver-popover-next-btn,
body.level2-tour-step10-hide-done .driver-popover-footer button:last-child {
  display: none !important;
}

/* Disable the star rating system on all modals for this game */
.star-container,
.star-wrapper,
.rive-star {
  display: none !important;
}

/* Start screen: game-specific background and thumbnail */

#layout-row-2 {
  flex: 3 !important;
}

#pane1 {
  min-width: 260px;
}

#pane2 {
  flex: 2.1 !important;
}

#pane3 {
  flex: 1.9 !important;
}

#pane1-activity,
#pane2-activity,
#pane3-activity {
  height: 100%;
  width: 100%;
  min-height: 0;
}

#pane2-activity {
  padding: 10px;
}

#pane1-activity {
  overflow-y: auto;
  padding: 10px;
}

/* Level 1 setup: pane matches content height — no tall empty scroll area */
#main:has(.cemental-board) {
  height: auto;
  max-height: 100%;
  min-height: 0;
}

#pane1:has(.cemental-board) {
  height: auto;
  max-height: min(92vh, calc(100dvh - 140px));
  flex: 0 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
}

#pane1-activity:has(.cemental-board) {
  height: auto;
  overflow-y: visible;
  flex: 0 0 auto;
}

/* driver.js sets .driver-active * { pointer-events: none } and adds a full-screen overlay.
   The overlay still receives clicks unless disabled; the feed is not inside .driver-active-element,
   so taps never reach Like/Comment/Share. Pass clicks through the dim layer and re-enable panes. */
.driver-active .driver-overlay {
  pointer-events: none !important;
}

body.driver-active #pane1,
body.driver-active #pane1 *,
body.driver-active #pane2,
body.driver-active #pane2 *,
body.driver-active #pane3,
body.driver-active #pane3 * {
  pointer-events: auto !important;
}

#level2-feed-meter-tour-highlight.driver-active-element {
  pointer-events: none !important;
}

.level2-first-post-actions-row {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 0;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
}

.insta-actions:has(#level2-first-post-actions) {
  justify-content: flex-start;
}

#level2-first-post-actions.driver-active-element {
  position: relative;
  z-index: 6;
  border-radius: 12px;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.95),
    0 0 18px rgba(37, 99, 235, 0.45);
}

.level2-tour-step4-desc .level2-tour-icon-inline {
  display: inline-block;
  font-size: 1.35rem;
  vertical-align: middle;
  line-height: 1;
}

.level2-tour-step4-desc {
  line-height: 1.55;
}

.level2-tour-step4-desc .level2-tour-step4-img {
  width: 1.35em;
  height: 1.35em;
  vertical-align: -0.25em;
  margin: 0 0.08em;
  object-fit: contain;
  display: inline-block;
}

.level2-tour-step4-desc .level2-tour-step4-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  vertical-align: -0.25em;
  margin: 0 0.08em;
}

.level2-tour-step4-desc .level2-tour-step4-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.level2-tour-step4-desc .level2-tour-step4-ico--heart {
  color: #e11d48;
}

.level2-tour-step4-desc .level2-tour-step4-ico--cloud {
  color: #64748b;
}

.level2-tour-step4-desc .level2-tour-step4-ico--share {
  color: #2563eb;
}

.instruction-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8f4ff;
  border-radius: 12px;
  padding: 14px;
  min-height: 100%;
}

.instruction-title {
  font-size: 1.05rem;
  font-family: "font-primary-bold";
  font-weight: 700;
  color: #1f2937;
}

/* Keep translated instruction titles visually identical to English titles. */
body.lang-translated .instruction-title {
  font-size: 1.05rem;
  font-family: "font-primary-bold";
  font-weight: 700;
}

.instruction-text {
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.35;
}

.helper-message {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #e9f6ff;
  color: #1d4f7a;
  border: 1px solid #c8e5f6;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.helper-message.visible {
  opacity: 1;
}

.legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.legend-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #374151;
  font-size: 0.88rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot.watch {
  background: #2563eb;
}
.dot.skip {
  background: #ef4444;
}
.dot.like {
  background: #10b981;
}
.dot.comment {
  background: #f59e0b;
}
.dot.share {
  background: #8b5cf6;
}

.feed-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.feed-shell--stack {
  gap: 0;
  min-height: 0;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #f0ebff, #edf4ff);
  border-radius: 12px;
  padding: 10px 12px;
}

.feed-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

/* Primary CTA — teal (review: Generate Feed as primary) */
.action-primary {
  border: none;
  background: #0d9488;
  color: #fff;
  border-radius: 999px;
  padding: 10px 22px;
  font-family: "font-primary-bold";
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.action-primary:hover:not(:disabled) {
  background: #0f766e;
  box-shadow: 0 3px 12px rgba(13, 148, 136, 0.45);
}

.action-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.character-card {
  border: 1px solid #d5d3f9;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.character-card.active {
  border-color: #6d28d9;
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.2);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ede9fe;
  color: #5b21b6;
  font-family: "font-primary-bold";
  margin-bottom: 8px;
}

.character-name {
  font-family: "font-primary-bold";
  margin-bottom: 6px;
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}

.interest-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interest-chip {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
}

.interest-chip.active {
  border-color: #2563eb;
  background: #dbeafe;
}

.post-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.post-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.post-card.placeholder {
  background: repeating-linear-gradient(-45deg, #f8fafc, #f8fafc 8px, #f1f5f9 8px, #f1f5f9 16px);
  color: #334155;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-index {
  font-family: "font-primary-bold";
  color: #334155;
}

.topic-tag {
  font-size: 0.75rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  padding: 3px 8px;
}

.post-title {
  margin-top: 6px;
  margin-bottom: 10px;
  color: #374151;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-chip {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

.action-chip.selected {
  border-color: #6d28d9;
  background: #f3e8ff;
  color: #6d28d9;
}

.action-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-icons {
  display: flex;
  gap: 7px;
}

.nav-icons span {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #c7d2fe;
}

.info-grid {
  display: grid;
  gap: 8px;
}

.info-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-card span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-family: "font-primary-bold";
}

.insta-feed-shell {
  background: #ffffff;
  border: 1px solid #dbe1ea;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.insta-feed-shell.no-brand {
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.cemental-dp {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  display: grid;
  place-items: center;
  font-family: "font-primary-bold";
  color: #475569;
  background: #f8fafc;
  overflow: hidden;
}

.cemental-dp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.insta-brand {
  padding: 10px 14px;
  border-bottom: 1px solid #eef2f7;
  font-family: "font-primary-bold";
  font-size: 1rem;
  background: linear-gradient(90deg, #fff1f2, #fff7ed, #eff6ff);
}

.insta-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #fafafa;
  padding: 8px 0;
  padding-bottom: 28px;
  position: relative;
}

/* Level 2: Next post row below active card */
.level2-feed-meter-tour-highlight {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  display: none;
  box-sizing: border-box;
  border-radius: 14px;
}

.level2-share-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: #111827;
  font-size: 1.35rem;
  line-height: 1;
}

.level2-share-btn[disabled] {
  cursor: default;
}

.level2-like-hint:not(.liked) {
  animation: level2LikeHintPulse 0.75s ease-in-out infinite;
  color: #0f172a !important;
  filter: drop-shadow(0 0 8px rgba(15, 23, 42, 0.9));
}

.level2-comment-hint {
  animation: hintPop 0.9s ease-in-out infinite;
}

@keyframes level2LikeHintPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.42);
  }
}

.level2-share-hint {
  animation: level2ShareVibrate 0.45s ease-in-out infinite;
}

@keyframes level2ShareVibrate {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-2px, 1px) rotate(-4deg);
  }
  50% {
    transform: translate(2px, -1px) rotate(4deg);
  }
  75% {
    transform: translate(-1px, -1px) rotate(-2deg);
  }
}

.level2-shared-done {
  animation: level2SharedPulse 0.65s ease forwards;
  color: #2563eb !important;
}

@keyframes level2SharedPulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1.12);
  }
}

/* Chromium: hide mute/volume/fullscreen/overflow on native video (PiP disabled via attribute + JS) */
video.feed-video::-webkit-media-controls-mute-button {
  display: none !important;
}

video.feed-video::-webkit-media-controls-volume-slider {
  display: none !important;
}

video.feed-video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

video.feed-video::-webkit-media-controls-overflow-button {
  display: none !important;
}

.insta-feed.interaction-feed-scroll-snap {
  scroll-behavior: auto;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  /* Inset snap region so previous/next slides peek above/below the current card */
  scroll-padding-block: clamp(28px, 9dvh, 88px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  max-height: none;
  flex: 1;
  min-height: 0;
  padding: 8px 6px 14px;
  overscroll-behavior-y: contain;
}

/* Level 3: all-video feed reads taller; tighten card cap so slides stay shorter than the scrollport */
.insta-feed.interaction-feed-scroll-snap[data-interaction-level="3"] {
  scroll-padding-block: clamp(32px, 11dvh, 104px);
}

.insta-feed.interaction-feed-scroll-snap[data-interaction-level="3"] .compact-feed-post {
  max-height: min(66vh, 480px);
}

.insta-feed.interaction-feed-scroll-snap::-webkit-scrollbar {
  width: 5px;
}

.insta-feed.interaction-feed-scroll-snap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* One “page” per post; shorter than viewport so prev/next peek above/below */
.feed-post-slide {
  scroll-snap-align: center;
  scroll-snap-stop: always;
  min-height: min(82%, 76dvh);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

.insta-feed.interaction-feed-scroll-snap[data-interaction-level="3"] .feed-post-slide {
  min-height: min(72%, 70dvh);
}

.feed-post-slide .insta-post {
  width: calc(100% - 4px);
  max-width: 420px;
  margin: 0 auto;
}

.compact-feed-post {
  display: flex;
  flex-direction: column;
  max-height: min(74vh, 540px);
  overflow: hidden;
  border-radius: 12px;
}

.compact-feed-post .post-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

.compact-feed-post .insta-post-header {
  padding: 6px 10px;
  flex-shrink: 0;
}

.compact-feed-post .insta-actions {
  padding: 10px 10px 4px;
  flex-shrink: 0;
}

.compact-feed-post .insta-likes,
.compact-feed-post .insta-comment {
  flex-shrink: 0;
}

.compact-feed-post .action-row {
  flex-shrink: 0;
}

.feed-post-action-placeholder {
  min-height: 46px;
  flex-shrink: 0;
}

.insta-feed.interaction-feed-scroll-snap .compact-feed-post video.feed-video.insta-image {
  width: 100%;
  height: min(24vh, 210px);
  min-height: min(24vh, 210px);
  max-height: min(24vh, 210px);
  object-fit: contain;
  background: #0f172a;
  flex-shrink: 0;
}

/* Level 2 tour: bird clip — pulsating ring over native play (pointer-events none; video receives taps) */
.level2-bird-video-wrap {
  position: relative;
  width: 100%;
  flex-shrink: 0;
}

.level2-bird-video-wrap video.feed-video {
  position: relative;
  z-index: 1;
  cursor: pointer;
  display: block; /* Remove inline baseline gap so wrapper height = video height exactly */
}

.level2-bird-video-wrap.level2-bird-play-ring-pulse::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  pointer-events: none;
  z-index: 5;
  border-radius: 999px;
  border: 3px solid rgba(37, 99, 235, 0.95);
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.22),
    0 4px 18px rgba(0, 0, 0, 0.45);
  background: transparent;
  animation: level2PlayHintPulse 1.1s ease-in-out infinite;
}

@keyframes level2PlayHintPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.98;
  }
  50% {
    transform: scale(1.07);
    opacity: 0.72;
  }
}

/* Level 2 tour: custom play overlay button — visible when paused, hidden during playback */
.level2-bird-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  padding: 0;
  padding-left: 3px; /* optical centre for ▶ */
  animation: level2PlayHintPulse 1.1s ease-in-out infinite;
}

.level2-bird-play-overlay.hidden {
  display: none;
}

/* Full image visible in band (wide comics, etc.); letterboxing uses neutral fill vs. cropping with cover */
.insta-feed.interaction-feed-scroll-snap .compact-feed-post img.insta-image {
  width: 100%;
  height: min(24vh, 210px);
  min-height: min(24vh, 210px);
  max-height: min(24vh, 210px);
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  aspect-ratio: unset;
  background: #f1f5f9;
}

/* Pull action icons slightly closer to the media band */
.insta-feed.interaction-feed-scroll-snap .compact-feed-post .insta-actions {
  padding-top: 10px;
}

.insta-post {
  background: #fff;
  border: 1px solid #edf2f7;
  margin: 0 10px 12px;
  border-radius: 8px;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.insta-post.feed-post-card.active-post {
  border: 2px solid #3b82f6;
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.22),
    0 14px 28px rgba(2, 6, 23, 0.28);
  z-index: 4;
  opacity: 1;
  filter: none;
}

.insta-post.feed-post-card.inactive-post {
  opacity: 0.4;
  filter: grayscale(0.95) contrast(0.88) brightness(1.02);
  pointer-events: none;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  transform: scale(0.98);
}

.active-post:not(.feed-post-card) {
  border: 2px solid #3b82f6;
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.25),
    0 16px 32px rgba(2, 6, 23, 0.35);
  z-index: 4;
}

.inactive-post:not(.feed-post-card) {
  opacity: 0.28;
  filter: grayscale(0.4);
  pointer-events: none;
}

.insta-post-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.insta-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e0ecff;
  color: #1e3a8a;
  font-family: "font-primary-bold";
  font-size: 0.82rem;
}

.insta-user-meta {
  flex: 1;
}

.insta-user {
  font-family: "font-primary-bold";
  font-size: 0.82rem;
  color: #111827;
}

.insta-location {
  font-size: 0.72rem;
  color: #6b7280;
}

.insta-more {
  border: none;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  font-size: 0.95rem;
}

.insta-image {
  width: 100%;
  display: block;
  object-fit: contain;
  height: auto;
  max-height: none;
  background: #fff;
}

.insta-post img.insta-image {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.insta-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px 6px;
  color: #111827;
}

.level2-actions-emphasis {
  gap: 14px;
  padding: 10px 12px 6px;
}

.insta-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.feed-action-icon {
  border: none;
  border-radius: 999px;
  background: #ffffff;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #111827;
  padding: 0;
  line-height: 1;
  font-size: 1.24rem;
}

.feed-action-icon.selected {
  border-color: #6d28d9;
  background: #f3e8ff;
  color: #6d28d9;
}

.feed-action-icon:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.feed-action-icon.feed-action-icon--visual {
  cursor: default;
}

/* Keep all level 5/7/11 action icons the same visual size. */
.feed-action-icon--like,
.feed-action-icon--comment,
.feed-action-icon--share,
.feed-action-icon--not_interested,
.feed-action-icon--no_interaction,
.feed-action-icon--not_share {
  font-size: 1.24rem;
}

/* Emoji glyphs are uneven across fonts; bump specific icons to visually match peers. */
.insta-feed[data-interaction-level="7"] .feed-action-icon--like,
.insta-feed[data-interaction-level="11"] .feed-action-icon--like {
  font-size: 1.42rem;
}

.insta-feed[data-interaction-level="11"] .feed-action-icon--comment {
  font-size: 1.34rem;
}

.level2-actions-emphasis .insta-icon {
  font-size: 1.55rem;
}

.level2-actions-emphasis .insta-heart,
.level2-actions-emphasis .insta-comment-btn {
  transform: scale(1.08);
}

.level2-guided-card {
  border: 2px solid #3b82f6;
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.2),
    0 14px 28px rgba(15, 23, 42, 0.18);
}

.level2-guided-media {
  outline: 3px solid #3b82f6;
  outline-offset: -3px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.insta-heart {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: #111827;
}

.insta-heart[disabled] {
  cursor: default;
}

.insta-heart.liked {
  color: #ef4444;
}

/* Level 11: after Share chip — share glyph vibrates once and stays blue until next post */
.compact-feed-post .insta-actions .insta-icon.level11-share-icon-active {
  display: inline-block;
  color: #2563eb;
}

.compact-feed-post .insta-actions .insta-icon.level11-share-icon-shake {
  animation: level11-share-icon-shake 0.55s ease-in-out;
}

@keyframes level11-share-icon-shake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  20% {
    transform: translateX(-5px) rotate(-10deg);
  }
  40% {
    transform: translateX(5px) rotate(10deg);
  }
  60% {
    transform: translateX(-4px) rotate(-6deg);
  }
  80% {
    transform: translateX(4px) rotate(6deg);
  }
}

.insta-comment-btn {
  border: none;
  background: transparent;
  width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
  color: #111827;
}

.insta-comment-btn[disabled] {
  cursor: default;
}

.hint-pop {
  animation: hintPop 0.9s ease-in-out infinite;
}

@keyframes hintPop {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.22);
    opacity: 0.8;
  }
}

.insta-save {
  margin-left: auto;
}

.insta-likes {
  padding: 0 10px 6px;
  font-family: "font-primary-bold";
  font-size: 0.82rem;
  color: #111827;
}

.insta-comment {
  padding: 0 10px 10px;
  font-size: 0.82rem;
  color: #111827;
}

.insta-comment-user {
  font-family: "font-primary-bold";
}

/* Feed: draw attention to the comment line as it appears (level 7 / 9; synced with meter ramp) */
.insta-comment.feed-comment-posted-highlight,
.insta-comment.level7-comment-posted-highlight {
  margin: 0 6px 8px;
  padding: 8px 10px;
  border-radius: 10px;
  animation: feed-comment-posted-pulse 1.15s ease-out forwards;
}

@keyframes feed-comment-posted-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    background-color: #eff6ff;
  }
  45% {
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.2);
    background-color: #dbeafe;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    background-color: transparent;
  }
}

.compact-feed-post .insta-actions .insta-icon.feed-comment-icon-posted-highlight,
.compact-feed-post .insta-actions .insta-icon.level7-comment-icon-posted-highlight {
  display: inline-block;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 10px;
  vertical-align: middle;
  animation: feed-comment-icon-posted-pulse 1.15s ease-out forwards;
}

@keyframes feed-comment-icon-posted-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    background-color: #eff6ff;
  }
  45% {
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.22);
    background-color: #dbeafe;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    background-color: transparent;
  }
}

.insta-post .post-title {
  padding: 0 10px 8px;
  margin-top: 2px;
}

.insta-post .action-row {
  padding: 0 10px 10px;
}

.hidden-actions {
  visibility: hidden;
  height: 0;
  padding: 0 10px;
  overflow: hidden;
}

.visible-actions {
  visibility: visible;
}

/* MCQ: column follows DOM order — primaryText is first (visual then prompt on levels 4, 6, 8, 10, 12) */
.mcq-container #mcq-question {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mcq-container #mcq-question .mcq-q-visual {
  width: 100%;
}

.mcq-container #mcq-question .mcq-q-prompt {
  margin-top: 0;
}

#mcq-question .mcq-q-gif {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

/* Level 4 watch-time clip: compact size for easy one-glance viewing. */
#mcq-question .mcq-q-gif.mcq-level4-watch-video {
  width: min(460px, 92%);
  max-height: 240px;
  object-fit: contain;
  /* background: #0f172a; */
}

video.mcq-q-gif::-webkit-media-controls-pip-button,
video.mcq-q-gif::-webkit-media-controls-translate-button,
video.mcq-q-gif::-webkit-media-controls-enhance-button {
  display: none !important;
}

/* Static Interest Meter chart (level 6): keep compact for one-glance readability */
#mcq-question .mcq-q-gif.mcq-q-chart {
  max-width: min(468px, 100%);
  width: 82.8%;
}

.mcq-option-img {
  display: block;
  max-width: 180px;
  height: auto;
  border-radius: 6px;
  margin-bottom: 4px;
}

#mcq-question .mcq-q-list {
  margin: 8px 0 12px;
  padding-left: 1.25rem;
}

.mcq-container-wrap {
  margin-top: 12px;
}

/* 1214-style side-by-side MCQ layout (media left, options right) */
#mcq-structure {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 2% 3%;
  box-sizing: border-box;
  overflow: auto;
}

#mcq-structure .mcq-container {
  margin-bottom: 8px;
}

#mcq-structure #mcq-question {
  border: none;
  padding: 0;
}

#mcq-image-options {
  display: flex;
  flex-direction: row;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

#mcq-image-options #mcq-images {
  flex: 0 0 48%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#mcq-image-options #mcq-images img,
#mcq-image-options #mcq-images video {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 8px;
}

#mcq-image-options #mcq-options {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

#mcq-structure > #submit-button {
  align-self: center;
  margin-top: 10px;
}

.mcq-video {
  width: 100%;
  border-radius: 8px;
}

@media screen and (max-width: 768px) {
  #mcq-image-options {
    flex-direction: column;
  }
  #mcq-image-options #mcq-images {
    flex: none;
  }
}

.mcq-side-by-side-layout .mcq-container {
  height: 100%;
  overflow: auto;
}

.mcq-side-by-side-layout .mcq-split-layout {
  display: grid;
  grid-template-columns: minmax(280px, 42%) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.mcq-side-by-side-layout .mcq-left-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mcq-side-by-side-layout .mcq-left-panel #mcq-primary-text,
.mcq-side-by-side-layout .mcq-left-panel #mcq-images {
  margin: 0;
}

.mcq-side-by-side-layout .mcq-left-panel .mcq-q-gif {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.mcq-side-by-side-layout .mcq-right-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mcq-side-by-side-layout .mcq-right-panel #mcq-secondary-text {
  margin: 0;
}

.mcq-side-by-side-layout .mcq-right-panel #submit-button {
  align-self: flex-start;
  margin-top: 4px;
}

/* 1213 / design review: reveal correct MCQ option in green after submit */
.mcq-option.mcq-correct-answer {
  background-color: #ecfdf5 !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 0 #059669 !important;
  color: #065f46 !important;
}

.mcq-option.mcq-correct-answer .mcq-marker {
  background-color: #10b981 !important;
  color: #ffffff !important;
}

.mcq-option.mcq-correct-answer .mcq-label {
  color: #065f46 !important;
}

.post-choice-popup {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
  border-radius: 999px;
  padding: 10px 16px;
  font-family: "font-primary-bold";
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99999;
}

.post-choice-popup.show {
  opacity: 1;
}

.backend-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
}

.backend-header {
  font-family: "font-primary-bold";
  color: #0f172a;
}

.backend-header-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-replay-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-family: "font-primary-bold";
  cursor: pointer;
}

.dashboard-replay-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dashboard-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 2px;
}

.dashboard-legend-item {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.76rem;
  color: #334155;
}

@keyframes dashboard-legend-dot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35);
  }
  50% {
    transform: scale(1.35);
    opacity: 0.92;
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
  }
}

.dashboard-legend-item--pulse .dashboard-legend-dot {
  animation: dashboard-legend-dot-pulse 0.85s ease-in-out infinite;
}

.dashboard-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
  margin-top: 0.2em;
}

.dashboard-legend-dot-neutral,
.legend-row .dashboard-legend-dot-neutral {
  background: #94a3b8;
  flex-shrink: 0;
}

.legend-row .dashboard-legend-dot {
  flex-shrink: 0;
  margin-top: 0.2em;
}

.axis-label {
  font-size: 0.78rem;
  color: #475569;
}

.axis-label.y {
  align-self: flex-start;
}

.chart-area {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-height: 300px;
}

.axis-label.y-side {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  font-size: 0.78rem;
  color: #475569;
}

.axis-label.x {
  align-self: center;
}

.axis-label-x-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin-top: 2px;
}

.axis-label-x-wrap .axis-label.x {
  align-self: center;
  text-align: center;
}

.axis-label.x-sub {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.25;
  max-width: none;
  width: 100%;
  margin-top: 10px;
  text-align: left;
}

.chart {
  flex: 1;
  display: flex;
  min-width: 0;
  border-left: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  padding: 10px 10px 12px;
  min-height: 300px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.6) 0%, rgba(241, 245, 249, 0.35) 100%);
  border-radius: 0 8px 0 0;
}

.chart-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.chart-labels-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
}

.chart-label-cell {
  flex: 1;
  min-width: 52px;
  text-align: center;
}

.chart-tracks-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  position: relative;
  height: 248px;
  width: 100%;
  padding: 0 2px;
}

/* Single dashed zero line across the full bar region */
.chart-zero-line-global {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  margin-top: -1px;
  height: 0;
  border-top: 2px dashed rgba(51, 65, 85, 0.55);
  z-index: 4;
  pointer-events: none;
}

.chart-track-cell {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 100%;
  min-width: 52px;
  position: relative;
  z-index: 1;
}

.bar-track {
  position: relative;
  width: 36px;
  height: 248px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.95) 0%, #e2e8f0 50%, rgba(226, 232, 240, 0.95) 100%);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.bar-stack--pos {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 50%;
  width: 100%;
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  min-height: 0;
  max-height: 50%;
  z-index: 2;
  overflow: hidden;
}

.bar-stack--neg {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  max-height: 50%;
  z-index: 2;
  overflow: hidden;
}

.bar-segment {
  flex-shrink: 0;
  min-height: 0;
}

.bar-segment--carry {
  opacity: 0.88;
  filter: grayscale(0.15);
}

.bar-stack--pos .bar-segment--pos:last-child {
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}

.bar-stack--neg .bar-segment--neg:last-child {
  border-bottom-left-radius: 3px;
  border-bottom-right-radius: 3px;
}

.bar-label {
  text-align: center;
  font-size: 0.72rem;
  color: #334155;
  min-height: 2rem;
  max-width: 100%;
  word-break: break-word;
  line-height: 1.2;
}

.cemental-board {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  border: 3px solid #2d2d2d;
  border-radius: 12px;
  background: #f9c1ff;
  padding: 16px 14px 20px;
  position: relative;
  overflow: visible;
  flex: 0 0 auto;
}

/* Stacked at top of board so the main heading never overlaps the badge */
.cemental-badge {
  position: static;
  align-self: center;
  flex-shrink: 0;
  background: #f4b21a;
  border: 2px solid #ef7f1a;
  border-radius: 14px;
  padding: 6px 14px;
  min-width: min(280px, 100%);
  max-width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.cemental-badge .name {
  display: block;
  width: 100%;
  text-align: center;
  font-family: "font-primary-bold";
  font-size: 1.15rem;
}

.cemental-badge .meta {
  font-size: 0.92rem;
}

.cemental-board h2 {
  text-align: center;
  margin: 0;
  font-size: clamp(1.15rem, 2.8vw, 2rem);
  line-height: 1.35;
  padding: 0 4px;
  flex-shrink: 0;
}

.cemental-board p {
  text-align: center;
  margin: 0;
  font-size: 1.12rem;
  flex-shrink: 0;
}

.setup-profile-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 4px 6px 0;
}

.setup-line1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.setup-thumb-image {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid #86efac;
  background: #f0fdf4;
  flex-shrink: 0;
}

.setup-profile-line1 {
  font-family: "font-primary-bold";
  font-size: 2rem;
  color: #0f172a;
  text-align: left;
}

.setup-profile-line2 {
  font-size: 1rem;
  color: #1f2937;
  line-height: 1.35;
  text-align: center;
  max-width: 86%;
}

.setup-profile-line2--center {
  width: 100%;
  max-width: 100%;
  text-align: center;
  font-family: "font-primary-bold";
  font-size: clamp(1.22rem, 2vw, 1.95rem);
  line-height: 1.28;
  margin-top: 2px;
}

.setup-badge-row {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Level 1: all topic chips in a single horizontal row (scroll on narrow viewports) */
.interest-circle-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  margin: 0 auto;
  padding: 4px 8px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.interest-circle {
  flex: 0 0 auto;
  width: 118px;
  height: 118px;
  margin: 0;
  border-radius: 999px;
  border: 3px solid #1f2937;
  background: #f3e8e6;
  display: grid;
  place-items: center;
  grid-template-rows: 1fr auto;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
}

.icon-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: transparent;
}

.interest-icon-image {
  width: 72px;
  height: 72px;
  object-fit: contain;
  pointer-events: none;
}

.icon-label {
  pointer-events: none;
}

/* Match visible icon scale with football */
.interest-icon-image[data-interest-id="sandwich"],
.interest-icon-image[data-interest-id="guitar"],
.interest-icon-image[data-interest-id="dog"],
.interest-icon-image[data-interest-id="juice"] {
  transform: scale(1.18);
  transform-origin: center;
}

.icon-label {
  font-size: 0.86rem;
  color: #1f2937;
  font-family: "font-primary-bold";
}

.interest-circle.active {
  box-shadow: 0 0 0 5px rgba(234, 88, 12, 0.35);
  border-color: #ea580c;
  background: #fff2ec;
}

.generate-row {
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  display: flex;
  justify-content: center;
  background: linear-gradient(to top, #f9c1ff 60%, rgba(249, 193, 255, 0));
}

@media screen and (max-width: 1000px) {
  #pane1 {
    min-width: 220px;
  }
  .character-grid {
    grid-template-columns: 1fr;
  }
  .interest-circle-grid {
    justify-content: flex-start;
    padding-bottom: 12px;
  }
  .interest-circle {
    width: 104px;
    height: 104px;
  }
  .setup-profile-intro {
    gap: 8px;
  }
  .setup-thumb-image {
    width: 78px;
    height: 78px;
  }
  .setup-profile-line1 {
    font-size: 1.45rem;
    text-align: left;
  }
  .setup-profile-line2 {
    font-size: 0.92rem;
    text-align: center;
    max-width: 96%;
  }
  .setup-profile-line2--center {
    font-size: clamp(1.02rem, 3.7vw, 1.28rem);
  }
  .mcq-side-by-side-layout .mcq-split-layout {
    grid-template-columns: 1fr;
  }
  .icon-placeholder {
    width: 64px;
    height: 64px;
  }
  .interest-icon-image {
    width: 64px;
    height: 64px;
  }
}
