/* ==========================================================================
   SAFARI – Træn Læse- og Tekstforståelse
   Designet af Teaching by Straarup
   OCR- & AppWriter-venligt stylesheet
   ========================================================================== */

:root {
  --bg-savanna: #eef9e6;
  --bg-card: rgba(252, 255, 249, 0.96);
  --bg-subtle: #e2f3d5;
  --bg-accent-soft: #d9f5c8;
  --bg-amber-soft: #fef9d8;

  --text-main: #112615;
  --text-muted: #2d4c33;
  --text-on-dark: #ffffff;

  --safari-green: #236e33;
  --safari-green-dark: #123e1b;
  --safari-green-light: #ccf2b8;

  --safari-amber: #d97706;
  --safari-amber-light: #fef3c7;
  --safari-gold: #72ce3b;

  --safari-earth: #1d572a;
  --safari-sky: #0ea5e9;

  --border-color: #7bbf6a;
  --border-strong: #3c8539;

  --success-bg: #dcfce7;
  --success-border: #15803d;
  --success-text: #14532d;

  --error-bg: #fee2e2;
  --error-border: #b91c1c;
  --error-text: #7f1d1d;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;

  --shadow-sm: 0 6px 18px rgba(15, 52, 22, 0.12);
  --shadow-md: 0 12px 28px rgba(15, 52, 22, 0.18);

  --base-font-size: 18px;
  --base-line-height: 1.65;
  --base-letter-spacing: 0.01em;
  --base-word-spacing: 0.04em;
}

/* Accessibility Toggles */
body.large-text {
  --base-font-size: 22px;
}

body.wide-spacing {
  --base-line-height: 2.0;
  --base-letter-spacing: 0.055em;
  --base-word-spacing: 0.16em;
}

body.high-contrast {
  --bg-savanna: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f0f0f0;
  --text-main: #000000;
  --text-muted: #111111;
  --safari-green: #0b3d1c;
  --safari-green-dark: #000000;
  --border-color: #222222;
  --border-strong: #000000;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg-savanna);
  color: var(--text-main);
  font-family: 'Verdana', 'Segoe UI', 'Trebuchet MS', system-ui, -apple-system, sans-serif;
  font-size: var(--base-font-size);
  line-height: var(--base-line-height);
  letter-spacing: var(--base-letter-spacing);
  word-spacing: var(--base-word-spacing);
  /* Crucial for AppWriter / CD-ORD / IntoWords OCR & selection reading */
  user-select: text;
  -webkit-user-select: text;
}

/* Ensure all text inside interactive elements remains selectable for AppWriter */
p, h1, h2, h3, h4, span, li, blockquote, label, button, article, section {
  user-select: text;
  -webkit-user-select: text;
}

/* Prevent iOS/Android long-press text selection & callout menu on touch game controls */
button,
.nav-tab,
.level-btn,
.mission-num-btn,
.mission-pill-btn,
.shelf-item-card,
.strat-tab-btn,
.strat-option-btn,
.who-suspect-card,
.who-accuse-btn,
.image-choice-card,
.primary-btn,
.secondary-btn,
.util-btn,
.lang-flag-btn,
.cp-door-btn,
.cp-path-btn,
.cp-key-btn,
.submode-btn,
.count-pill {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(35, 110, 51, 0.16);
}

.runner-viewport,
.runner-viewport *,
.runner-ctrl-btn,
.runner-ctrl-btn *,
.orbit-word-chip,
.orbit-word-chip * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Allow selecting/reading text inside runner checkpoint & game-over modals */
.runner-checkpoint-modal,
.runner-checkpoint-modal p,
.runner-checkpoint-modal h3,
.runner-checkpoint-modal span {
  user-select: text;
  -webkit-user-select: text;
}

::selection {
  background: #fde047;
  color: #000000;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.jungle-page-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.top-utility-bar,
.site-header,
.main-container,
.site-footer {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   Top Utility Bar (OCR / Accessibility / Language)
   ========================================================================== */
.top-utility-bar {
  background: linear-gradient(90deg, #0d2e14 0%, #164920 50%, #0d2e14 100%);
  color: #f4f7f4;
  font-size: 0.85rem;
  padding: 0.45rem 1.25rem;
  border-bottom: 2px solid rgba(134, 239, 172, 0.28);
}

.utility-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.ocr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.ocr-dot {
  width: 10px;
  height: 10px;
  background-color: #4ade80;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #4ade80;
}

.reading-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.util-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.util-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

.util-btn[aria-pressed="true"] {
  background: #fde047;
  color: #142818;
  border-color: #fde047;
}

.lang-selector-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-flag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  padding: 0.25rem 0.62rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-flag-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
}

.lang-flag-btn.active {
  background: #ffffff;
  color: #142818;
  border-color: #fde047;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.lang-flag-btn .flag-svg {
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

/* ==========================================================================
   Site Header & Level Selector
   ========================================================================== */
.site-header {
  background: linear-gradient(180deg, rgba(244, 253, 236, 0.93) 0%, rgba(215, 243, 196, 0.92) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.45rem 1.15rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  min-width: 0;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.brand-area:hover {
  transform: translateY(-1px);
}

.brand-area:hover .brand-title {
  color: var(--safari-green);
}

.brand-logo {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  overflow: visible;
}

.brand-kicker {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--safari-earth);
  line-height: 1.1;
}

.brand-title {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.05;
  color: var(--safari-green-dark);
  letter-spacing: 0.03em;
}

.brand-subtitle {
  margin: 0.1rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Level Selector Panel */
.level-selector-panel {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.level-panel-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.level-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.42rem;
}

.level-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-width: auto;
  padding: 0.3rem 0.72rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}

.level-btn:hover {
  border-color: var(--safari-green);
  transform: translateY(-1px);
}

.level-btn.active {
  background: var(--safari-green);
  color: #ffffff;
  border-color: var(--safari-green-dark);
  box-shadow: 0 3px 9px rgba(38, 99, 57, 0.25);
}

.level-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.level-animal-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin-bottom: 0;
}

.level-animal-img {
  display: block;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
  transition: transform 0.18s ease;
}

.level-btn:hover .level-animal-img {
  transform: scale(1.07);
}

.level-animal-small {
  height: 24px;
}

.level-animal-medium {
  height: 28px;
}

.level-animal-large {
  height: 32px;
}

.level-name {
  font-weight: 800;
  font-size: 0.86rem;
  margin-top: 0;
  white-space: nowrap;
}

.level-sub {
  font-size: 0.72rem;
  opacity: 0.88;
}

.level-sub:empty {
  display: none;
}

/* Star Passport */
.safari-passport {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--safari-amber-light);
  border: 2px solid var(--safari-gold);
  padding: 0.34rem 0.78rem;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.passport-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.passport-info {
  display: flex;
  flex-direction: column;
}

.passport-label {
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--safari-earth);
  text-transform: uppercase;
  line-height: 1.1;
  white-space: nowrap;
}

.passport-count {
  font-size: 1.1rem;
  color: #78350f;
  line-height: 1.1;
}

@media (max-width: 980px) {
  .header-inner {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   Main Activity Navigation Tabs
   ========================================================================== */
.main-nav {
  background: linear-gradient(90deg, #133e1b 0%, #1f612b 50%, #133e1b 100%);
  border-top: 2px solid #0e3015;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.18);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 0.65rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.15rem;
}

.nav-tab {
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.94);
  border: none;
  border-bottom: 4px solid transparent;
  padding: 0.78rem 0.45rem;
  font-family: inherit;
  font-size: clamp(0.76rem, 0.92vw, 0.9rem);
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-tab.active {
  background: var(--bg-savanna);
  color: var(--safari-green-dark);
  border-bottom-color: var(--safari-gold);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

/* ==========================================================================
   Main Container & Shared Components
   ========================================================================== */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2.5rem;
  min-height: 74vh;
}

.activity-view[hidden] {
  display: none !important;
}

.activity-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.activity-kicker {
  display: none !important;
}

.activity-header-bar h2 {
  margin: 0.2rem 0 0.4rem;
  font-size: 1.75rem;
  font-weight: 900;
  color: #c2410c;
  text-shadow:
    0 2px 0 #fffdf5,
    0 -1.5px 0 #fffdf5,
    2px 0 0 #fffdf5,
    -2px 0 0 #fffdf5,
    1.5px 1.5px 0 #fffdf5,
    -1.5px 1.5px 0 #fffdf5,
    1.5px -1.5px 0 #fffdf5,
    -1.5px -1.5px 0 #fffdf5,
    0 4px 12px rgba(255, 253, 245, 0.9);
}

.activity-header-bar p {
  margin: 0;
  max-width: 760px;
  font-size: 1.04rem;
  font-weight: 700;
  color: #7c2d12;
  text-shadow:
    0 1.5px 0 #fffdf5,
    0 -1.5px 0 #fffdf5,
    1.5px 0 0 #fffdf5,
    -1.5px 0 0 #fffdf5,
    1px 1px 0 #fffdf5,
    -1px 1px 0 #fffdf5,
    1px -1px 0 #fffdf5,
    -1px -1px 0 #fffdf5,
    0 2px 8px rgba(255, 253, 245, 0.92);
}

/* Buttons */
.primary-btn {
  background: var(--safari-green);
  color: #ffffff;
  border: 2px solid var(--safari-green-dark);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.35rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.primary-btn:hover:not(:disabled) {
  background: var(--safari-green-dark);
  transform: translateY(-1px);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-btn {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.2rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.secondary-btn:hover {
  background: #e5dec9;
}

.tts-btn,
.tts-small {
  display: none !important;
}

/* Feedback Bar */
.feedback-bar {
  margin-top: 0.9rem;
  padding: 0.85rem 1.05rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  box-shadow: var(--shadow-sm);
}

.feedback-bar[hidden],
.feedback-bar .primary-btn[hidden] {
  display: none !important;
}

#sent-feedback-bar {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.feedback-bar.is-correct {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.feedback-bar.is-wrong {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

.feedback-message {
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.42;
  width: 100%;
}

#sent-feedback-bar .feedback-message {
  width: auto;
  flex: 1;
}

.feedback-bar .primary-btn {
  padding: 0.48rem 0.98rem;
  font-size: 0.88rem;
  border-radius: 9px;
  align-self: flex-end;
  white-space: nowrap;
}

/* ==========================================================================
   VIEW 0: HOME OVERVIEW
   ========================================================================== */
.hero-banner {
  background: linear-gradient(135deg, rgba(236, 253, 224, 0.96) 0%, rgba(210, 246, 235, 0.95) 100%);
  border: 2.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 0.7rem;
  box-shadow: var(--shadow-sm);
}

.current-level-pill {
  display: inline-block;
  background: var(--safari-green);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.hero-content h2 {
  margin: 0 0 0.15rem;
  font-size: 1.35rem;
  line-height: 1.15;
  color: var(--safari-green-dark);
}

.hero-content p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--text-main);
}

.hero-illustration {
  width: 155px;
  flex-shrink: 0;
  line-height: 0;
}

.hero-banner-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 2px solid #2d6a32;
  box-shadow: 0 3px 8px rgba(18, 45, 24, 0.18);
}

.activity-cards-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 0.75rem;
  align-items: stretch;
}

.activity-overview-card {
  background: linear-gradient(180deg, rgba(254, 255, 252, 0.97) 0%, rgba(238, 250, 230, 0.96) 100%);
  border: 2px solid var(--border-color);
  border-top: 4px solid var(--safari-green);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.88rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.activity-overview-card .primary-btn {
  padding: 0.42rem 0.9rem;
  font-size: 0.88rem;
}

.activity-overview-card.is-featured {
  grid-column: 1;
  grid-row: 1 / span 3;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-card-visual {
  position: relative;
  flex: 1 1 auto;
  min-height: 210px;
  overflow: hidden;
  border-bottom: 2px solid var(--border-color);
  background: #d9f0c7;
}

.featured-bg-img,
.featured-card-visual > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 54%;
  display: block;
  transition: transform 0.35s ease;
}

.activity-overview-card.is-featured:hover .featured-bg-img,
.activity-overview-card.is-featured:hover .featured-card-visual > svg {
  transform: scale(1.03);
}

.featured-card-content {
  padding: 0.75rem 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  background: linear-gradient(180deg, rgba(254, 255, 252, 0.99) 0%, rgba(238, 250, 230, 0.98) 100%);
}

.activity-overview-card.is-featured .card-title-group h3 {
  font-size: 1.1rem;
  margin-bottom: 0.18rem;
}

.activity-overview-card.is-featured .card-desc {
  font-size: 0.86rem;
  line-height: 1.32;
}

@media (max-width: 980px) {
  .activity-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }

  .activity-overview-card.is-featured {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .featured-card-visual {
    min-height: 200px;
  }
}

@media (max-width: 620px) {
  .activity-cards-grid {
    grid-template-columns: 1fr;
  }
}

.activity-overview-card:hover {
  transform: translateY(-2px);
  border-color: var(--safari-green);
  box-shadow: var(--shadow-md);
}

.card-top-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.card-emoji-badge {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  background: radial-gradient(circle at 50% 45%, rgba(254, 249, 224, 0.92) 0%, rgba(232, 246, 218, 0.65) 100%);
  border: 1.5px solid rgba(134, 186, 114, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.card-illustrated-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(28, 52, 24, 0.22));
  transition: transform 0.2s ease;
}

.activity-overview-card:hover .card-illustrated-icon {
  transform: scale(1.07) rotate(-2deg);
}

.card-title-group h3 {
  margin: 0 0 0.14rem;
  font-size: 1.02rem;
  color: var(--safari-green-dark);
}

.card-desc {
  margin: 0;
  color: var(--text-main);
  font-size: 0.84rem;
  line-height: 1.28;
}

.card-features-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.card-features-list li {
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   VIEW 1: SENTENCE PROGRESSION & 3 IMAGES
   ========================================================================== */
#view-sentences .activity-header-bar {
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
}

#view-sentences .activity-header-bar > div:first-child {
  flex: 1 1 320px;
  min-width: 0;
}

#view-sentences .activity-header-bar h2 {
  margin: 0 0 0.12rem;
  font-size: 1.32rem;
  line-height: 1.18;
}

#view-sentences .activity-header-bar p {
  font-size: 0.86rem;
  line-height: 1.25;
  max-width: none;
}

.count-selector-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 0.32rem 0.6rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.count-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.count-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.count-pill {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  padding: 0.24rem 0.52rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.count-pill:hover {
  border-color: var(--safari-green);
}

.count-pill.active {
  background: var(--safari-green);
  color: #ffffff;
  border-color: var(--safari-green-dark);
}

.progression-status-card {
  background: #eff8eb;
  border: 2px solid var(--safari-green);
  border-bottom: 1px solid var(--border-color);
  border-radius: 12px 12px 0 0;
  padding: 0.42rem 0.95rem 0.38rem;
  margin-bottom: 0;
}

.prog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 0.28rem;
}

.difficulty-badge {
  background: var(--bg-amber-soft);
  color: #78350f;
  border: 1px solid var(--safari-gold);
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
}

.progress-track {
  width: 100%;
  height: 7px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--safari-green) 0%, var(--safari-gold) 100%);
  transition: width 0.3s ease;
}

.reading-prompt-card {
  background: var(--bg-card);
  border: 2px solid var(--safari-green);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 0.55rem 0.95rem 0.6rem;
  margin-bottom: 0.7rem;
  box-shadow: var(--shadow-sm);
}

.prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

#view-sentences .prompt-toolbar {
  margin-bottom: 0.12rem;
}

.prompt-instruction {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--safari-earth);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.target-sentence-text {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.36;
  padding: 0.05rem 0;
}

.target-sentence-text.is-completed {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.38;
}

.three-images-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.image-choice-card {
  background: var(--bg-card);
  border: 2.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: var(--shadow-sm);
}

.image-choice-card:hover:not(.disabled) {
  transform: translateY(-3px);
  border-color: var(--safari-green);
  box-shadow: var(--shadow-md);
}

.image-choice-card.is-selected {
  border-color: var(--safari-green);
  background: var(--success-bg);
  box-shadow: 0 0 0 3px rgba(35, 110, 51, 0.22), var(--shadow-md);
  transform: translateY(-2px);
}

.image-choice-card.selected-correct {
  border-color: var(--success-border);
  background: var(--success-bg);
}

.image-choice-card.selected-wrong {
  border-color: var(--error-border);
  background: var(--error-bg);
  opacity: 0.72;
  cursor: not-allowed;
}

.image-svg-frame {
  width: 100%;
  aspect-ratio: 800 / 520;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border-strong);
  background: #e0f2fe;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.image-svg-frame svg {
  width: 100%;
  height: 100%;
  display: block;
}

.safari-rain-layer {
  will-change: transform;
  animation-name: safariRainFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.safari-rain-far {
  animation-duration: 1.45s;
}

.safari-rain-mid {
  animation-duration: 1.02s;
}

.safari-rain-near {
  animation-duration: 0.72s;
}

.safari-rain-splash {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: safariRainSplash 1.15s ease-out infinite;
}

@keyframes safariRainFall {
  from { transform: translate(0px, 0px); }
  to { transform: translate(-54px, 260px); }
}

@keyframes safariRainSplash {
  0% { opacity: 0; transform: scale(0.45); }
  25% { opacity: 0.9; transform: scale(0.95); }
  75% { opacity: 0.35; transform: scale(1.3); }
  100% { opacity: 0; transform: scale(1.45); }
}

@media (prefers-reduced-motion: reduce) {
  .safari-rain-layer,
  .safari-rain-splash {
    animation: none !important;
  }
}

.image-choice-label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--safari-green-dark);
  background: var(--bg-subtle);
  padding: 0.22rem 0.85rem;
  border-radius: 999px;
}

/* ==========================================================================
   VIEW 2: SAFARI-BANEN (OBSTACLE COURSE PUZZLE GAME)
   ========================================================================== */
.mission-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  width: 100%;
}

.mission-pill-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 2px solid var(--border-color);
  border-radius: 9px;
  padding: 0.35rem 0.68rem;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.mission-pill-btn.active {
  background: var(--safari-green);
  color: #ffffff;
  border-color: var(--safari-green-dark);
}

.mission-pill-btn.completed::after {
  content: " ⭐";
}

.obstacle-game-layout {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  gap: 1.5rem;
  align-items: start;
}

.instruction-scroll-card {
  background: #fffdf7;
  border: 3px solid var(--safari-gold);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.instruction-scroll-card h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--safari-green-dark);
}

.instruction-text-body {
  font-size: 1.12rem;
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.obs-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.check-step-pill {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
}

.check-step-pill.done {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.movement-control-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.control-section-title {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--safari-earth);
  margin-bottom: 0.6rem;
}

/* ==========================================================================
   Side-Scrolling 2D Safari Runner (Activity 2)
   ========================================================================== */
.runner-activity-layout {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.runner-instruction-card {
  margin-bottom: 0;
}

.runner-viewport {
  position: relative;
  width: 100%;
  height: 410px;
  border-radius: 22px;
  border: 4px solid #5c3a1d;
  overflow: hidden;
  background: #87ceeb;
  box-shadow: 0 12px 30px rgba(35, 22, 10, 0.22), inset 0 2px 10px rgba(0, 0, 0, 0.2);
  outline: none;
  user-select: none;
}

.runner-viewport:focus {
  box-shadow: 0 0 0 4px var(--safari-gold), 0 12px 30px rgba(35, 22, 10, 0.25);
}

.runner-parallax-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% + 260px);
  height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center bottom;
  will-change: transform;
  z-index: 1;
}

.runner-hud {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 15;
  pointer-events: none;
}

.runner-progress-pill {
  background: rgba(255, 253, 245, 0.94);
  border: 2px solid #78350f;
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.86rem;
  font-weight: 800;
  color: #2d1a08;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

.runner-mini-bar {
  width: 110px;
  height: 10px;
  background: #e5dcc5;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #b49a73;
}

.runner-mini-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #facc15, #eab308);
  transition: width 0.1s linear;
}

.runner-timer-hud-pill {
  background: rgba(255, 253, 245, 0.95);
  border: 2px solid #166534;
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: #14532d;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

.runner-timer-hud-pill[hidden] {
  display: none !important;
}

.runner-timer-hud-pill.is-warning {
  background: #fef2f2;
  border-color: #dc2626;
  color: #991b1b;
}

.runner-toast,
.runner-state-pill {
  display: none !important;
}

.runner-world {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  will-change: transform;
  z-index: 4;
}

.runner-ground-strip {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100px;
  background: url("../assets/props/safari_ground.png") repeat-x left bottom;
  background-size: 230px 100px;
  z-index: 2;
  pointer-events: none;
}

.runner-ground-strip::before {
  display: none;
}

.runner-entity {
  position: absolute;
  z-index: 6;
  pointer-events: none;
}

.runner-entity-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 252, 242, 0.95);
  color: #2d1a08;
  border: 1.5px solid #92400e;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

.runner-item-entity {
  transition: transform 0.25s ease, opacity 0.25s ease;
  animation: itemFloat 1.8s infinite ease-in-out;
}

.runner-item-entity.is-collected {
  transform: translateY(-45px) scale(0.2);
  opacity: 0;
}

.runner-checkpoint-entity {
  pointer-events: auto;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.runner-checkpoint-entity:hover {
  filter: brightness(1.06);
}

/* Interactive Checkpoint Overlay Modal inside #obs-runner-viewport */
.runner-checkpoint-modal {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 500px);
  max-height: calc(100% - 58px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, rgba(254, 255, 252, 0.98) 0%, rgba(238, 250, 230, 0.98) 100%);
  border: 2.5px solid var(--border-strong);
  border-top: 4px solid var(--safari-green);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  z-index: 25;
  box-shadow: var(--shadow-md);
  color: var(--text-main);
  animation: cpPopIn 0.2s ease-out;
}

@keyframes cpPopIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.runner-checkpoint-modal.is-shake {
  animation: cpShake 0.35s ease;
}

@keyframes cpShake {
  0%, 100% { transform: translateX(-50%); }
  25% { transform: translateX(calc(-50% - 8px)); }
  75% { transform: translateX(calc(-50% + 8px)); }
}

.cp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.cp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--safari-green-light);
  color: var(--safari-green-dark);
  border: 1.5px solid var(--border-color);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}

.runner-checkpoint-modal.is-gameover {
  border-color: var(--border-strong);
  border-top: 4px solid var(--safari-green);
  background: linear-gradient(180deg, rgba(254, 255, 252, 0.98) 0%, rgba(238, 250, 230, 0.98) 100%);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.cp-badge.is-gameover-badge {
  background: var(--bg-amber-soft);
  color: #78350f;
  border: 1.5px solid var(--safari-gold);
  font-size: 0.78rem;
  padding: 0.22rem 0.8rem;
  margin: 0 auto;
}

.cp-gameover-title {
  margin: 0.3rem 0 0.55rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--safari-green-dark);
}

.runner-checkpoint-modal.is-gameover .cp-prompt {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem;
  margin: 0 0 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.cp-gameover-actions {
  margin-top: 0.2rem;
  display: flex;
  justify-content: center;
}

.cp-retry-btn {
  background: var(--safari-green);
  color: #ffffff;
  border: 2px solid var(--safari-green-dark);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.4rem;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, transform 0.1s ease;
}

.cp-retry-btn:hover {
  background: var(--safari-green-dark);
  transform: translateY(-1px);
}

.runner-player.is-gameover .exp-rig {
  transform: translate(-6px, 28px) rotate(-68deg);
  transition: transform 0.28s ease;
}

.cp-close-btn {
  background: var(--bg-savanna);
  border: 1.5px solid var(--border-color);
  color: var(--safari-green-dark);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.cp-close-btn:hover {
  background: var(--safari-green-light);
}

.cp-prompt {
  margin: 0 0 0.65rem;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

.cp-doors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.cp-door-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.65rem 0.45rem;
  border-radius: 12px;
  border: 2.5px solid #451a03;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
  transition: transform 0.12s ease, filter 0.12s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.cp-door-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.cp-door-btn:active {
  transform: translateY(1px);
}

.cp-door-kbd {
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.28);
  padding: 1px 7px;
  border-radius: 999px;
}

.cp-paths-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.cp-path-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.6rem 0.45rem;
  background: #fffbeb;
  border: 2px solid #92400e;
  border-radius: 12px;
  color: #451a03;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 #b45309;
  transition: transform 0.12s ease, background 0.12s ease;
}

.cp-path-btn:hover {
  background: #fef3c7;
  transform: translateY(-2px);
}

.cp-path-pos {
  font-size: 0.72rem;
  font-weight: 800;
  color: #15803d;
}

.cp-code-layout {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cp-code-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.cp-code-input {
  flex: 1;
  min-width: 0;
  font-family: monospace;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-align: center;
  padding: 0.42rem 0.6rem;
  border-radius: 10px;
  border: 2px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--safari-green-dark);
  outline: none;
}

.cp-code-input:focus {
  border-color: var(--safari-green);
  box-shadow: 0 0 0 3px rgba(35, 110, 51, 0.2);
}

.cp-code-submit {
  padding: 0.52rem 1rem;
  border-radius: 10px;
  border: 2px solid var(--safari-green-dark);
  background: var(--safari-green);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.cp-code-submit:hover {
  background: var(--safari-green-dark);
}

.cp-keypad-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  justify-content: center;
}

.cp-key-btn {
  min-width: 36px;
  height: 34px;
  padding: 0 0.45rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--border-color);
}

.cp-key-btn:hover {
  background: var(--bg-accent-soft);
  border-color: var(--safari-green);
}

.cp-key-btn.is-clear {
  background: var(--bg-amber-soft);
  border-color: var(--safari-amber);
  color: #78350f;
}

.cp-feedback {
  margin-top: 0.45rem;
  font-size: 0.84rem;
  font-weight: 800;
  color: #b91c1c;
  text-align: center;
}

@keyframes itemFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.runner-player {
  position: absolute;
  width: 86px;
  height: 132px;
  z-index: 10;
  pointer-events: none;
  transform-origin: center bottom;
  will-change: transform, left, bottom;
}

.runner-player-inner {
  width: 100%;
  height: 100%;
  transform-origin: center bottom;
}

/* Articulated Explorer Limb Pivot Origins */
.runner-player .exp-rig {
  transform-box: view-box;
  transform-origin: 50px 86px;
  transition: transform 0.16s ease;
}

.runner-player .exp-head {
  transform-box: view-box;
  transform-origin: 50px 38px;
  transition: transform 0.16s ease;
}

.runner-player .exp-limb-arm-front,
.runner-player .exp-limb-arm-back {
  transform-box: view-box;
  transform-origin: 50px 48px;
  transition: transform 0.14s ease;
}

.runner-player .exp-limb-leg-front,
.runner-player .exp-limb-leg-back {
  transform-box: view-box;
  transform-origin: 50px 74px;
  transition: transform 0.14s ease;
}

.runner-player .exp-swim-waves {
  opacity: 0;
  transition: opacity 0.18s ease;
}

/* 1. WALKING ANIMATION (Legs & Arms Swing in Opposite Phase) */
.runner-player.is-walking .exp-rig {
  animation: expWalkBob 0.22s infinite ease-in-out;
}

.runner-player.is-walking .exp-limb-leg-front {
  animation: expLegFrontWalk 0.44s infinite ease-in-out;
}

.runner-player.is-walking .exp-limb-leg-back {
  animation: expLegBackWalk 0.44s infinite ease-in-out;
}

.runner-player.is-walking .exp-limb-arm-front {
  animation: expArmFrontWalk 0.44s infinite ease-in-out;
}

.runner-player.is-walking .exp-limb-arm-back {
  animation: expArmBackWalk 0.44s infinite ease-in-out;
}

/* 2. JUMPING IN MID-AIR ANIMATION */
.runner-player.is-jumping .exp-ground-shadow {
  opacity: 0;
}

.runner-player.is-jumping .exp-rig {
  transform: rotate(7deg);
}

.runner-player.is-jumping .exp-limb-leg-front {
  transform: rotate(-38deg);
}

.runner-player.is-jumping .exp-limb-leg-back {
  transform: rotate(32deg);
}

.runner-player.is-jumping .exp-limb-arm-front {
  transform: rotate(-58deg);
}

.runner-player.is-jumping .exp-limb-arm-back {
  transform: rotate(32deg);
}

/* 3. CRAWLING ANIMATION (Low Horizontal Posture + Active Crawl Movement) */
.runner-player.is-crawling .exp-rig {
  transform: translate(0px, 24px) rotate(72deg);
}

.runner-player.is-crawling .exp-head {
  transform: rotate(-48deg);
}

.runner-player.is-crawling .exp-limb-arm-front {
  transform: rotate(-55deg);
}

.runner-player.is-crawling .exp-limb-arm-back {
  transform: rotate(-25deg);
}

.runner-player.is-crawling .exp-limb-leg-front {
  transform: rotate(-18deg);
}

.runner-player.is-crawling .exp-limb-leg-back {
  transform: rotate(18deg);
}

.runner-player.is-crawling.is-moving .exp-limb-arm-front {
  animation: expCrawlArmF 0.36s infinite ease-in-out;
}

.runner-player.is-crawling.is-moving .exp-limb-arm-back {
  animation: expCrawlArmB 0.36s infinite ease-in-out;
}

.runner-player.is-crawling.is-moving .exp-limb-leg-front {
  animation: expCrawlLegF 0.36s infinite ease-in-out;
}

.runner-player.is-crawling.is-moving .exp-limb-leg-back {
  animation: expCrawlLegB 0.36s infinite ease-in-out;
}

/* 4. SWIMMING ANIMATION (Swimmer Posture, Arm Strokes, Flutter Kick & Waves) */
.runner-player.is-swimming .exp-ground-shadow {
  opacity: 0;
}

.runner-player.is-swimming .exp-rig {
  animation: expSwimBob 0.7s infinite ease-in-out;
}

.runner-player.is-swimming .exp-head {
  transform: rotate(-44deg);
}

.runner-player.is-swimming .exp-limb-arm-front {
  animation: expSwimArmF 0.52s infinite ease-in-out;
}

.runner-player.is-swimming .exp-limb-arm-back {
  animation: expSwimArmB 0.52s infinite ease-in-out;
}

.runner-player.is-swimming .exp-limb-leg-front {
  animation: expSwimLegF 0.34s infinite ease-in-out;
}

.runner-player.is-swimming .exp-limb-leg-back {
  animation: expSwimLegB 0.34s infinite ease-in-out;
}

.runner-player.is-swimming .exp-swim-waves {
  opacity: 1;
  animation: expWaveSplash 0.55s infinite ease-in-out;
}

@keyframes expWalkBob {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3.5px); }
}

@keyframes expLegFrontWalk {
  0%, 100% { transform: rotate(-30deg); }
  50% { transform: rotate(30deg); }
}

@keyframes expLegBackWalk {
  0%, 100% { transform: rotate(30deg); }
  50% { transform: rotate(-30deg); }
}

@keyframes expArmFrontWalk {
  0%, 100% { transform: rotate(26deg); }
  50% { transform: rotate(-28deg); }
}

@keyframes expArmBackWalk {
  0%, 100% { transform: rotate(-28deg); }
  50% { transform: rotate(26deg); }
}

@keyframes expCrawlArmF {
  0%, 100% { transform: rotate(-72deg); }
  50% { transform: rotate(-22deg); }
}

@keyframes expCrawlArmB {
  0%, 100% { transform: rotate(-22deg); }
  50% { transform: rotate(-72deg); }
}

@keyframes expCrawlLegF {
  0%, 100% { transform: rotate(-26deg); }
  50% { transform: rotate(18deg); }
}

@keyframes expCrawlLegB {
  0%, 100% { transform: rotate(18deg); }
  50% { transform: rotate(-26deg); }
}

@keyframes expSwimBob {
  0%, 100% { transform: translate(0px, 24px) rotate(64deg); }
  50% { transform: translate(0px, 20px) rotate(60deg); }
}

@keyframes expSwimArmF {
  0%, 100% { transform: rotate(-85deg); }
  50% { transform: rotate(-15deg); }
}

@keyframes expSwimArmB {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(-85deg); }
}

@keyframes expSwimLegF {
  0%, 100% { transform: rotate(-20deg); }
  50% { transform: rotate(20deg); }
}

@keyframes expSwimLegB {
  0%, 100% { transform: rotate(20deg); }
  50% { transform: rotate(-20deg); }
}

@keyframes expWaveSplash {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

/* 5. VICTORY DANCE ANIMATION AT GOAL TENT */
.runner-player.is-celebrating .exp-ground-shadow {
  animation: expDanceShadow 0.64s infinite ease-in-out;
}

.runner-player.is-celebrating .exp-rig {
  animation: expDanceBody 0.64s infinite ease-in-out;
}

.runner-player.is-celebrating .exp-head {
  animation: expDanceHead 0.64s infinite ease-in-out;
}

.runner-player.is-celebrating .exp-limb-arm-front {
  animation: expDanceArmFront 0.64s infinite ease-in-out;
}

.runner-player.is-celebrating .exp-limb-arm-back {
  animation: expDanceArmBack 0.64s infinite ease-in-out;
}

.runner-player.is-celebrating .exp-limb-leg-front {
  animation: expDanceLegFront 0.64s infinite ease-in-out;
}

.runner-player.is-celebrating .exp-limb-leg-back {
  animation: expDanceLegBack 0.64s infinite ease-in-out;
}

@keyframes expDanceShadow {
  0%, 50%, 100% { transform: scaleX(1); opacity: 0.28; }
  25%, 75% { transform: scaleX(0.72); opacity: 0.16; }
}

@keyframes expDanceBody {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-12px) rotate(-6deg); }
  50% { transform: translateY(-1px) rotate(0deg); }
  75% { transform: translateY(-12px) rotate(6deg); }
}

@keyframes expDanceHead {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg) translateY(-1.5px); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(10deg) translateY(-1.5px); }
}

@keyframes expDanceArmFront {
  0%, 100% { transform: rotate(-132deg); }
  25% { transform: rotate(-162deg); }
  50% { transform: rotate(-116deg); }
  75% { transform: rotate(-158deg); }
}

@keyframes expDanceArmBack {
  0%, 100% { transform: rotate(126deg); }
  25% { transform: rotate(156deg); }
  50% { transform: rotate(110deg); }
  75% { transform: rotate(152deg); }
}

@keyframes expDanceLegFront {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-28deg); }
  50% { transform: rotate(6deg); }
  75% { transform: rotate(18deg); }
}

@keyframes expDanceLegBack {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(22deg); }
  50% { transform: rotate(-6deg); }
  75% { transform: rotate(-24deg); }
}

.runner-controls-bar {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.runner-controls-left {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem;
}

/* Inverted-T Keyboard Arrow Key Cluster */
.runner-keycluster {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 128px));
  grid-template-rows: auto auto;
  gap: 0.42rem;
  background: rgba(120, 90, 45, 0.07);
  padding: 0.48rem;
  border-radius: 14px;
  border: 1.5px solid rgba(120, 90, 45, 0.22);
}

.runner-keycap.keycap-up {
  grid-column: 2;
  grid-row: 1;
}

.runner-keycap.keycap-left {
  grid-column: 1;
  grid-row: 2;
}

.runner-keycap.keycap-down {
  grid-column: 2;
  grid-row: 2;
}

.runner-keycap.keycap-right {
  grid-column: 3;
  grid-row: 2;
}

.runner-ctrl-btn {
  background: #fdfbf6;
  color: var(--text-main);
  border: 2px solid #967850;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 4px 0 #b89f78, 0 5px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.12s ease, border-color 0.12s ease;
  user-select: none;
  touch-action: manipulation;
}

.runner-keycap {
  flex-direction: column;
  padding: 0.38rem 0.5rem 0.42rem;
  gap: 0.14rem;
  min-height: 64px;
}

.keycap-arrow {
  font-size: 1.05rem;
  line-height: 1;
  color: #15803d;
  font-weight: 900;
}

.keycap-label {
  font-size: 0.8rem;
  line-height: 1.15;
  font-weight: 800;
  white-space: nowrap;
}

.runner-ctrl-btn:hover {
  border-color: var(--safari-green);
  background: #f0fdf4;
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #86a373, 0 6px 10px rgba(0, 0, 0, 0.1);
}

.runner-ctrl-btn:active,
.runner-ctrl-btn.is-active {
  background: var(--safari-green);
  color: #ffffff;
  border-color: var(--safari-green-dark);
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--safari-green-dark);
}

.runner-ctrl-btn:active .keycap-arrow,
.runner-ctrl-btn.is-active .keycap-arrow {
  color: #ffffff;
}

.runner-ctrl-btn:active .ctrl-kbd,
.runner-ctrl-btn.is-active .ctrl-kbd {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.runner-ctrl-primary {
  background: var(--safari-green-light);
  border-color: var(--safari-green);
  box-shadow: 0 4px 0 #5b9a68, 0 5px 8px rgba(0, 0, 0, 0.08);
}

.runner-extra-keys {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  justify-content: flex-end;
}

.runner-side-key {
  min-height: 52px;
  padding: 0.48rem 0.9rem;
  justify-content: flex-start;
}

.runner-ctrl-reset {
  background: #fffbeb;
  border-color: var(--safari-gold-dark);
  box-shadow: 0 4px 0 #d49a2a, 0 5px 8px rgba(0, 0, 0, 0.08);
}

.ctrl-kbd {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.08);
  padding: 0.1rem 0.38rem;
  border-radius: 5px;
  line-height: 1.1;
}

/* Right Side: Timer Toggle + 20s-60s Slider Panel */
.runner-timer-panel {
  background: var(--bg-savanna);
  border: 2px solid var(--border-strong);
  border-radius: 14px;
  padding: 0.65rem 1rem;
  min-width: 280px;
  max-width: 360px;
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.runner-timer-panel.is-active {
  background: #f0fdf4;
  border-color: var(--safari-green);
  box-shadow: 0 3px 10px rgba(22, 101, 52, 0.1);
}

.runner-timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.runner-timer-toggle {
  background: #ffffff;
  color: var(--text-main);
  border: 2px solid #967850;
  border-radius: 999px;
  padding: 0.35rem 0.85rem 0.35rem 0.6rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  transition: all 0.15s ease;
}

.runner-timer-toggle:hover {
  border-color: var(--safari-green);
  background: #f0fdf4;
}

.timer-switch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #64748b;
  transition: all 0.15s ease;
}

.runner-timer-toggle[aria-pressed="true"] {
  background: var(--safari-green);
  color: #ffffff;
  border-color: var(--safari-green-dark);
}

.runner-timer-toggle[aria-pressed="true"] .timer-switch-dot {
  background: #fde047;
  border-color: #ffffff;
  box-shadow: 0 0 6px rgba(253, 224, 71, 0.9);
}

.runner-timer-readout {
  font-size: 0.88rem;
  font-weight: 900;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  white-space: nowrap;
}

.runner-timer-panel.is-active .runner-timer-readout {
  background: #dcfce7;
  color: #14532d;
  border: 1.5px solid #86efac;
}

.runner-timer-panel.is-active .runner-timer-readout.is-warning {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.runner-timer-slider-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.runner-timer-panel.is-active .runner-timer-slider-row {
  opacity: 1;
}

.timer-bound {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
}

.runner-timer-slider {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  accent-color: var(--safari-green);
  cursor: pointer;
}

/* ==========================================================================
   VIEW 3: MISSIONS (RECIPE, ORDER, SUITCASE, INVITATION)
   ========================================================================== */
.submode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.submode-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.95rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.submode-btn.active {
  background: var(--safari-green);
  color: #ffffff;
  border-color: var(--safari-green-dark);
}

.mission-task-selector {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mission-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mission-status-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--safari-green-dark);
}

.mission-step-btn {
  background: var(--bg-savanna);
  color: var(--text-main);
  border: 2px solid var(--border-color);
  border-radius: 999px;
  padding: 0.38rem 0.9rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.mission-step-btn:hover {
  border-color: var(--safari-green);
  background: var(--safari-green-light);
}

.mission-numbers-grid {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  gap: 0.42rem;
}

.mission-num-btn {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  background: var(--bg-savanna);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.14s ease;
}

.mission-num-btn:hover {
  border-color: var(--safari-green);
  transform: translateY(-1px);
}

.mission-num-btn.is-completed {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.mission-num-btn.active {
  background: var(--safari-green);
  border-color: var(--safari-green-dark);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(31, 68, 43, 0.25);
}

.missions-split-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.5rem;
  align-items: start;
}

.mission-document-card {
  background: #fffdf8;
  border: 3px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.doc-type-badge {
  display: none !important;
}

.mission-doc-title {
  margin: 0 0 0.85rem;
  font-size: 1.4rem;
  color: var(--safari-green-dark);
}

.mission-doc-body {
  font-size: 1.08rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
}

.mission-doc-body p {
  margin-top: 0;
  margin-bottom: 0.8rem;
}

.mission-doc-body p:last-child {
  margin-bottom: 0;
}

.mission-doc-body ul {
  margin: 0.5rem 0;
  padding-left: 1.35rem;
}

.mission-workspace-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.workspace-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--safari-green-dark);
}

.selected-counter {
  background: var(--bg-amber-soft);
  border: 1px solid var(--safari-gold);
  color: #78350f;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.items-shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.shelf-item-card {
  background: var(--bg-savanna);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  position: relative;
}

.shelf-item-card:hover {
  border-color: var(--safari-green);
  transform: translateY(-2px);
}

.shelf-item-card.is-selected {
  background: var(--safari-green-light);
  border-color: var(--safari-green);
  box-shadow: 0 0 0 2px var(--safari-green);
}

.shelf-item-card.is-selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 8px;
  background: var(--safari-green);
  color: #ffffff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-icon-box {
  width: 114px;
  height: 92px;
  padding: 6px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 38%, #ffffff 0%, #fffbeb 72%, #f5ead4 100%);
  border: 1.5px solid #e2d5b8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 5px rgba(45, 26, 8, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.item-icon-box .mission-item-sprite {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(45, 26, 8, 0.18));
}

.runner-item-entity > .mission-item-sprite {
  max-width: 74px;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.28));
}

.item-icon-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.item-label-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.mission-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
}

/* ==========================================================================
   VIEW 4: TEKST-DETEKTIVEN (MARK IN TEXT)
   ========================================================================== */
.detective-split-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 1.5rem;
  align-items: start;
}

.detective-text-card {
  background: var(--bg-card);
  border: 3px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.detective-story-title {
  margin: 0 0 0.6rem;
  font-size: 1.45rem;
  color: var(--safari-green-dark);
}

.ocr-helper-note {
  background: var(--bg-amber-soft);
  border: 1px solid var(--safari-gold);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font-size: 0.86rem;
  color: #78350f;
  margin-bottom: 1rem;
}

.detective-passage-body {
  font-size: 1.12rem;
  line-height: 1.85;
  background: #fffdf9;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.35rem;
}

.detective-passage-body p {
  margin-top: 0;
  margin-bottom: 1rem;
}

.detective-passage-body p:last-child {
  margin-bottom: 0;
}

.det-sentence {
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.14s ease;
  border-bottom: 2px dashed transparent;
}

.det-sentence:hover {
  background-color: #fef9c3;
  border-bottom-color: var(--safari-amber);
}

.det-sentence.marked-candidate {
  background-color: #fde047;
  color: #000000;
  font-weight: 600;
  border-bottom: 2px solid #ca8a04;
}

.det-sentence.marked-correct {
  background-color: #86efac;
  color: #064e3b;
  font-weight: 700;
}

.det-sentence.marked-wrong {
  background-color: #fca5a5;
  color: #7f1d1d;
}

.detective-question-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 1.25rem;
}

.question-progress {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--safari-earth);
  background: var(--bg-subtle);
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}

.detective-q-text {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.4;
  color: var(--safari-green-dark);
}

.selected-sentence-preview {
  margin: 0.85rem 0 1.05rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-savanna);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.preview-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.preview-quote {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  font-style: italic;
  color: var(--text-main);
  font-weight: 600;
}

.detective-question-card .primary-btn {
  font-size: 0.9rem;
  padding: 0.6rem 1.1rem;
}

.detective-question-card .feedback-message {
  font-size: 0.9rem;
}

.full-width-btn {
  width: 100%;
}

/* ==========================================================================
   VIEW 5: READING STRATEGIES (LÆSESTRATEGIER)
   ========================================================================== */
.strategy-tabs-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.strat-tab-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.6rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.strat-tab-btn:hover {
  border-color: var(--safari-green);
}

.strat-tab-btn.active {
  background: var(--safari-green);
  color: #ffffff;
  border-color: var(--safari-green-dark);
}

.strategy-guide-banner {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 1.05rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.strategy-guide-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.22rem;
}

.strategy-guide-badge {
  background: var(--safari-green-light);
  color: var(--safari-green-dark);
  border: 1px solid var(--border-color);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  line-height: 1.3;
  flex-shrink: 0;
}

.strategy-guide-header strong {
  color: var(--safari-green-dark);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.3;
}

.strategy-guide-desc {
  margin: 0;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
}

.strategies-split-layout {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 1rem;
  align-items: start;
}

.strat-text-card,
.strat-question-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.strat-ex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.strat-passage-box {
  background: #fffdf8;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin-top: 0;
  font-size: 1.04rem;
  line-height: 1.6;
}

.strat-passage-box h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--safari-green-dark);
  font-size: 1.14rem;
}

.strat-passage-box p:first-child {
  margin-top: 0;
}

.strat-passage-box p:last-child {
  margin-bottom: 0;
}

.strat-question-title {
  margin: 0 0 0.85rem;
  font-size: 1.08rem;
  line-height: 1.38;
  color: var(--safari-green-dark);
}

.strat-options-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.strat-option-btn {
  background: var(--bg-savanna);
  color: var(--text-main);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.14s ease;
}

.strat-option-btn:hover:not(:disabled) {
  border-color: var(--safari-green);
  background: var(--bg-accent-soft);
}

.strat-option-btn.opt-correct {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
  font-weight: 700;
}

.strat-option-btn.opt-wrong {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

.opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ==========================================================================
   Activity 6: Ordboblen (Text + Question Bubble with Orbiting Words)
   ========================================================================== */
.bubble-split-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.5rem;
  align-items: start;
}

.bubble-text-card,
.bubble-arena-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.bubble-arena-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.bubble-hint-pill {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--safari-earth);
  background: var(--bg-accent-soft);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.bubble-stage {
  position: relative;
  width: 100%;
  min-height: 490px;
  background: radial-gradient(circle at 50% 48%, #f8fded 0%, #e1f3d2 62%, #c9e6b8 100%);
  border: 3px solid #2e6f3e;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.55rem;
  padding: 1.85rem 1.35rem 2.1rem;
  user-select: none;
  box-shadow: inset 0 0 36px rgba(20, 62, 30, 0.16), 0 10px 24px rgba(22, 54, 28, 0.12);
}

.bubble-stage-scenery {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bub-bg-photo {
  position: absolute;
  inset: -8px;
  background-size: cover;
  background-position: center;
  opacity: 0.36;
  filter: saturate(1.15) contrast(1.03);
}

.bub-bg-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 253, 242, 0.88) 0%, rgba(238, 250, 226, 0.68) 56%, rgba(190, 228, 172, 0.52) 100%);
}

.bub-canopy-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bub-corner-bush {
  position: absolute;
  bottom: -10px;
  width: 96px;
  height: auto;
  opacity: 0.88;
  filter: drop-shadow(0 4px 8px rgba(15, 38, 20, 0.25));
}

.bub-corner-bush-left {
  left: -12px;
}

.bub-corner-flowers {
  position: absolute;
  bottom: -6px;
  left: 58px;
  width: 58px;
  height: auto;
  opacity: 0.92;
  filter: drop-shadow(0 3px 6px rgba(15, 38, 20, 0.22));
}

.bub-corner-mascot {
  position: absolute;
  bottom: 62px;
  left: 10px;
  width: 68px;
  height: 68px;
  object-fit: contain;
  opacity: 0.95;
  filter: drop-shadow(0 6px 10px rgba(20, 45, 22, 0.28));
}

.bub-corner-prop-right {
  position: absolute;
  bottom: 58px;
  right: 12px;
  width: 62px;
  height: 62px;
  object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 5px 10px rgba(20, 45, 22, 0.25));
}

.bub-sky-accent {
  position: absolute;
  top: 74px;
  right: 22px;
  width: 42px;
  height: 42px;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 4px 6px rgba(20, 45, 22, 0.2));
}

.bubble-orbit-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.bubble-orbit-row {
  position: relative;
  z-index: 4;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: center;
  justify-items: center;
}

.question-bubble-center {
  position: relative;
  z-index: 3;
  width: min(405px, 92%);
  background:
    radial-gradient(circle at 50% 18%, #ffffff 0%, #fffdf4 58%, #f2f9eb 100%);
  border: 3.5px solid #1f5c34;
  border-radius: 48px;
  padding: 1.35rem 1.45rem 1.3rem;
  text-align: center;
  box-shadow:
    0 6px 0 #143d22,
    0 18px 34px rgba(18, 48, 26, 0.26),
    0 0 0 5px rgba(250, 204, 21, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Decorative speech/thought bubble circles leading toward the safari animal */
.question-bubble-center::before,
.question-bubble-center::after {
  content: "";
  position: absolute;
  background: linear-gradient(180deg, #ffffff 0%, #eef8e6 100%);
  border: 3px solid #1f5c34;
  box-shadow: 0 3px 0 #143d22;
  border-radius: 50%;
  pointer-events: none;
}

.question-bubble-center::before {
  width: 19px;
  height: 19px;
  bottom: -15px;
  left: 42px;
}

.question-bubble-center::after {
  width: 12px;
  height: 12px;
  bottom: -27px;
  left: 27px;
}

.question-bubble-center.is-drag-over {
  transform: scale(1.04);
  border-color: var(--safari-gold-dark);
  box-shadow:
    0 6px 0 #b45309,
    0 0 0 8px rgba(245, 158, 11, 0.32),
    0 18px 34px rgba(31, 68, 43, 0.28);
}

.question-bubble-center.is-correct-bubble {
  border-color: var(--success-border);
  background: linear-gradient(180deg, #ffffff 0%, #dcfce7 100%);
}

.bubble-q-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #2e7d32 0%, #1b5e20 100%);
  color: #ffffff;
  border: 1.5px solid #facc15;
  padding: 0.24rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
  box-shadow: 0 2px 6px rgba(20, 56, 28, 0.24);
}

.bubble-q-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: #132e1b;
  line-height: 1.38;
  margin: 0 0 0.9rem;
  user-select: text;
}

.bubble-answer-slot {
  min-height: 48px;
  border: 2.5px dashed #b45309;
  background: linear-gradient(180deg, rgba(254, 249, 195, 0.85) 0%, rgba(253, 230, 138, 0.65) 100%);
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 5px rgba(180, 83, 9, 0.12);
  transition: all 0.2s ease;
}

.question-bubble-center.is-drag-over .bubble-answer-slot {
  background: #fef08a;
  border-style: solid;
  border-color: #ca8a04;
  transform: scale(1.03);
}

.bubble-answer-slot.is-filled-correct {
  border-style: solid;
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success-text);
  font-weight: 800;
  font-size: 1.02rem;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

.slot-placeholder {
  font-size: 0.92rem;
  font-weight: 800;
  color: #78350f;
}

.orbit-word-chip {
  --arch-y: 0px;
  position: relative;
  transform: translateY(var(--arch-y));
  pointer-events: auto;
  width: 100%;
  max-width: 218px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbf2 65%, #e3f4dc 100%);
  color: #14331c;
  border: 2.5px solid #2b6a3c;
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.24;
  text-align: center;
  overflow-wrap: break-word;
  word-break: break-word;
  cursor: grab;
  box-shadow:
    0 4px 0 #1b4928,
    0 10px 18px rgba(18, 46, 24, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.2s ease;
  touch-action: none;
}

.orbit-word-chip::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 16%;
  right: 16%;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

/* Gentle arch curve for top and bottom rows without any horizontal overlap */
.bubble-orbit-top .orbit-word-chip:nth-child(1),
.bubble-orbit-top .orbit-word-chip:nth-child(3) {
  --arch-y: 10px;
}

.bubble-orbit-top .orbit-word-chip:nth-child(2) {
  --arch-y: -4px;
}

.bubble-orbit-bottom .orbit-word-chip:nth-child(1),
.bubble-orbit-bottom .orbit-word-chip:nth-child(3) {
  --arch-y: -10px;
}

.bubble-orbit-bottom .orbit-word-chip:nth-child(2) {
  --arch-y: 4px;
}

.orbit-word-chip:hover:not(:disabled) {
  transform: translateY(calc(var(--arch-y) - 2px)) scale(1.05);
  border-color: #d97706;
  background: linear-gradient(180deg, #fffef7 0%, #fef3c7 100%);
  box-shadow:
    0 5px 0 #b45309,
    0 12px 22px rgba(180, 83, 9, 0.26),
    inset 0 2px 0 #ffffff;
}

.orbit-word-chip:active:not(:disabled) {
  cursor: grabbing;
}

.orbit-word-chip.is-dragging {
  opacity: 0.92;
  z-index: 30;
  cursor: grabbing;
  transition: none;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.orbit-word-chip.chip-correct {
  opacity: 0;
  pointer-events: none;
  transform: translateY(var(--arch-y)) scale(0.5);
}

.orbit-word-chip.chip-wrong {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
  animation: chipShake 0.42s ease;
}

@keyframes chipShake {
  0%, 100% { transform: translate(0, var(--arch-y)); }
  25% { transform: translate(-8px, var(--arch-y)); }
  75% { transform: translate(8px, var(--arch-y)); }
}

/* ==========================================================================
   Activity 7: Hvem gjorde det? (Mystery + 3 Animated Suspects with Alibis)
   ========================================================================== */
.whodunit-split-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.35rem;
  align-items: start;
}

.whodunit-case-card,
.whodunit-arena-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow-sm);
}

.whodunit-clues-box {
  margin-top: 1.1rem;
  background: var(--bg-savanna);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
}

.clues-box-title {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--safari-earth);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.clues-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.96rem;
  line-height: 1.45;
  color: var(--text-main);
}

.clues-list li + li {
  margin-top: 0.25rem;
}

.whodunit-stage {
  position: relative;
  width: 100%;
  min-height: 245px;
  border: 3px solid #2e6f3e;
  border-radius: 20px;
  overflow: hidden;
  padding: 1rem 0.85rem 0.9rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-shadow: inset 0 0 28px rgba(15, 42, 22, 0.22);
}

.whodunit-stage-scenery {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.who-bg-photo {
  position: absolute;
  inset: -6px;
  background-size: cover;
  background-position: center bottom;
  opacity: 0.48;
  filter: saturate(1.12);
}

.who-bg-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(242, 251, 232, 0.45) 0%, rgba(226, 245, 211, 0.55) 68%, rgba(44, 102, 52, 0.42) 100%);
}

.who-spotlight {
  position: absolute;
  top: -20px;
  bottom: 0;
  width: 34%;
  left: 33%;
  background: radial-gradient(ellipse at 50% 60%, rgba(254, 249, 195, 0.78) 0%, rgba(254, 240, 138, 0.22) 55%, rgba(255, 255, 255, 0) 78%);
  opacity: 0;
  transition: left 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  pointer-events: none;
}

.who-spotlight.active {
  opacity: 1;
}

.who-spotlight.pos-0 {
  left: 1%;
}

.who-spotlight.pos-1 {
  left: 33%;
}

.who-spotlight.pos-2 {
  left: 65%;
}

.who-corner-bush {
  position: absolute;
  bottom: -10px;
  width: 78px;
  height: auto;
  opacity: 0.85;
}

.who-corner-bush-left {
  left: -12px;
}

.who-corner-bush-right {
  right: -12px;
  transform: scaleX(-1);
}

.whodunit-suspects-row {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.who-suspect-card {
  height: 100%;
  background: rgba(255, 255, 255, 0.86);
  border: 2.5px solid rgba(46, 111, 62, 0.55);
  border-radius: 18px;
  padding: 0.55rem 0.45rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 14px rgba(18, 45, 24, 0.16);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.who-suspect-card:hover {
  transform: translateY(-2px);
  border-color: var(--safari-green);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 20px rgba(18, 45, 24, 0.24);
}

.who-suspect-card.is-selected {
  border-color: var(--safari-green);
  background: linear-gradient(180deg, #ffffff 0%, #e4f7da 100%);
  box-shadow: 0 0 0 3px rgba(35, 110, 51, 0.22), 0 8px 18px rgba(18, 45, 24, 0.2);
}

.who-suspect-card.is-caught {
  border-color: var(--success-border);
  background: linear-gradient(180deg, #ffffff 0%, #dcfce7 100%);
}

.who-alibi-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: #e8f5e2;
  color: #1b4d27;
  border: 1px solid rgba(46, 111, 62, 0.35);
}

.who-suspect-card.is-visited .who-alibi-pill {
  background: #dcfce7;
  color: #166534;
}

.who-suspect-card.is-selected .who-alibi-pill {
  background: #f59e0b;
  color: #ffffff;
  border-color: #b45309;
}

.who-suspect-figure {
  position: relative;
  height: 118px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  --who-delay: 0s;
}

/* Multi-layer articulated puppet rig: feet planted, chest breathing, head/neck moving */
.who-rig {
  position: relative;
  display: inline-block;
  line-height: 0;
  filter: drop-shadow(0 5px 8px rgba(15, 35, 18, 0.28));
  transform-origin: 50% 100%;
}

.who-rig-layer {
  user-select: none;
  pointer-events: none;
  will-change: transform;
}

.who-layer-legs {
  position: relative;
  display: block;
  max-height: 108px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: 50% 100%;
}

.who-layer-torso,
.who-layer-head {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 1. Upright posture (monkey, giraffe, parrot, flamingo, guide, chef, scientist, photographer) */
.who-suspect-figure.pose-upright .who-layer-legs {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 33%, #000 43%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 33%, #000 43%, #000 100%);
  transform-origin: 50% 100%;
}

.who-suspect-figure.pose-upright .who-layer-torso {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 29%, #000 39%, #000 66%, transparent 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 29%, #000 39%, #000 66%, transparent 78%, transparent 100%);
  transform-origin: 50% 72%;
}

.who-suspect-figure.pose-upright .who-layer-head {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 32%, transparent 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 32%, transparent 45%, transparent 100%);
  transform-origin: 48% 40%;
}

/* 2. Quadruped posture facing left (hippo, lion, elephant, zebra, turtle, crocodile) */
.who-suspect-figure.pose-quad .who-layer-legs {
  -webkit-mask-image: linear-gradient(120deg, transparent 0%, transparent 29%, #000 41%, #000 100%);
  mask-image: linear-gradient(120deg, transparent 0%, transparent 29%, #000 41%, #000 100%);
  transform-origin: 55% 100%;
}

.who-suspect-figure.pose-quad .who-layer-torso {
  -webkit-mask-image: radial-gradient(ellipse 46% 38% at 62% 48%, #000 0%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 46% 38% at 62% 48%, #000 0%, #000 55%, transparent 100%);
  transform-origin: 62% 66%;
}

.who-suspect-figure.pose-quad .who-layer-head {
  -webkit-mask-image: linear-gradient(120deg, #000 0%, #000 28%, transparent 42%, transparent 100%);
  mask-image: linear-gradient(120deg, #000 0%, #000 28%, transparent 42%, transparent 100%);
  transform-origin: 42% 46%;
}

.who-suspect-shadow {
  width: 66px;
  height: 9px;
  border-radius: 50%;
  background: rgba(15, 38, 20, 0.22);
  margin-top: -3px;
  animation: whoShadowBreathe 3.2s ease-in-out infinite;
  animation-delay: var(--who-delay);
}

/* Grounded lower legs subtle stance cushion (feet never leave ground) */
.who-suspect-figure .who-layer-legs {
  animation: whoLegsGround 3.2s ease-in-out infinite;
  animation-delay: var(--who-delay);
}

/* Natural chest/ribcage breathing + articulated head/neck movements per character type */
.who-suspect-figure.anim-bob .who-layer-torso {
  animation: whoTorsoBreathe 3.2s ease-in-out infinite;
  animation-delay: var(--who-delay);
}
.who-suspect-figure.anim-bob .who-layer-head {
  animation: whoHeadNod 4.2s ease-in-out infinite;
  animation-delay: var(--who-delay);
}

.who-suspect-figure.anim-bounce .who-layer-torso {
  animation: whoTorsoPerk 2.7s ease-in-out infinite;
  animation-delay: var(--who-delay);
}
.who-suspect-figure.anim-bounce .who-layer-head {
  animation: whoHeadPerk 3.4s ease-in-out infinite;
  animation-delay: var(--who-delay);
}

.who-suspect-figure.anim-sway .who-layer-torso {
  animation: whoTorsoBreathe 3.6s ease-in-out infinite;
  animation-delay: var(--who-delay);
}
.who-suspect-figure.anim-sway .who-layer-head {
  animation: whoHeadLook 4.6s ease-in-out infinite;
  animation-delay: var(--who-delay);
}

.who-suspect-figure.anim-prowl .who-layer-torso {
  animation: whoTorsoProwl 3.4s ease-in-out infinite;
  animation-delay: var(--who-delay);
}
.who-suspect-figure.anim-prowl .who-layer-head {
  animation: whoHeadProwl 4.1s ease-in-out infinite;
  animation-delay: var(--who-delay);
}

.who-suspect-figure.anim-flutter .who-layer-torso {
  animation: whoTorsoPerk 2.3s ease-in-out infinite;
  animation-delay: var(--who-delay);
}
.who-suspect-figure.anim-flutter .who-layer-head {
  animation: whoHeadFlutter 2.9s ease-in-out infinite;
  animation-delay: var(--who-delay);
}

/* Expressive talking animation when suspect is selected and giving alibi */
.who-suspect-card.is-selected .who-layer-head {
  animation: whoHeadTalk 1.35s ease-in-out infinite !important;
}
.who-suspect-card.is-selected .who-layer-torso {
  animation: whoTorsoTalk 1.35s ease-in-out infinite !important;
}

@keyframes whoLegsGround {
  0%, 100% { transform: scaleY(1) scaleX(1); }
  50% { transform: scaleY(0.99) scaleX(1.008); }
}

@keyframes whoShadowBreathe {
  0%, 100% { transform: scaleX(1); opacity: 0.22; }
  50% { transform: scaleX(1.06); opacity: 0.27; }
}

@keyframes whoTorsoBreathe {
  0%, 100% { transform: scaleX(1) scaleY(1) translateY(0); }
  50% { transform: scaleX(1.045) scaleY(1.032) translateY(-1.5px); }
}

@keyframes whoTorsoPerk {
  0%, 100% { transform: scaleX(1) scaleY(1) translateY(0); }
  35% { transform: scaleX(1.04) scaleY(1.042) translateY(-2.5px); }
  70% { transform: scaleX(1.015) scaleY(0.992) translateY(0.5px); }
}

@keyframes whoTorsoProwl {
  0%, 100% { transform: scaleX(1) scaleY(1) translateX(0); }
  50% { transform: scaleX(1.045) scaleY(1.03) translateX(-1.5px) translateY(-1px); }
}

@keyframes whoHeadNod {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  28% { transform: translate(-1.5px, -2.5px) rotate(3.2deg); }
  58% { transform: translate(0.5px, 1.5px) rotate(-2.4deg); }
  82% { transform: translate(-0.8px, -1px) rotate(1.4deg); }
}

@keyframes whoHeadPerk {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  25% { transform: translate(-2px, -3.5px) rotate(4.2deg) scale(1.02); }
  55% { transform: translate(1px, -1px) rotate(-3deg) scale(1.01); }
  80% { transform: translate(-1px, 1px) rotate(1.8deg) scale(1); }
}

@keyframes whoHeadLook {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  32% { transform: translate(-2.2px, -2px) rotate(3.6deg); }
  66% { transform: translate(1.2px, 1px) rotate(-2.6deg); }
}

@keyframes whoHeadProwl {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  40% { transform: translate(-3px, 1.5px) rotate(-3.2deg); }
  75% { transform: translate(0.5px, -2px) rotate(2.4deg); }
}

@keyframes whoHeadFlutter {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  22% { transform: translate(-1.5px, -3.5px) rotate(5deg); }
  48% { transform: translate(1px, -2px) rotate(-3.5deg); }
  76% { transform: translate(-1px, 0.5px) rotate(2.2deg); }
}

@keyframes whoHeadTalk {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  20% { transform: translate(-2px, -3.2px) rotate(4.2deg) scale(1.025); }
  42% { transform: translate(0.5px, 1.2px) rotate(-2.5deg) scale(1); }
  65% { transform: translate(-1.5px, -2.5px) rotate(3.2deg) scale(1.02); }
  85% { transform: translate(0.5px, 0.8px) rotate(-1.5deg) scale(1); }
}

@keyframes whoTorsoTalk {
  0%, 100% { transform: scaleX(1) scaleY(1) translateY(0); }
  25% { transform: scaleX(1.045) scaleY(1.038) translateY(-2px); }
  50% { transform: scaleX(1.01) scaleY(0.995) translateY(0); }
  75% { transform: scaleX(1.038) scaleY(1.03) translateY(-1.5px); }
}

.who-suspect-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  min-height: 2.4em;
  width: 100%;
  margin-top: 0.1rem;
}

.who-suspect-name {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--safari-green-dark);
}

/* Alibi Speech Bubble Card */
.whodunit-alibi-card {
  position: relative;
  z-index: 5;
  margin-top: 0.9rem;
  background: var(--bg-savanna);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-sm);
}

.alibi-speech-tail {
  position: absolute;
  top: -30px;
  left: 50%;
  width: 48px;
  height: 31px;
  transform: translateX(-50%);
  pointer-events: none;
  overflow: visible;
  opacity: 0;
  transition: left 0.32s cubic-bezier(0.22, 1, 0.36, 1), transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.whodunit-alibi-card.has-speaker .alibi-speech-tail {
  opacity: 1;
}

.alibi-tail-fill {
  fill: var(--bg-savanna);
}

.alibi-tail-stroke {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.whodunit-alibi-card.speaker-pos-0 .alibi-speech-tail {
  left: 17.5%;
  transform: translateX(-50%) skewX(-10deg);
}

.whodunit-alibi-card.speaker-pos-1 .alibi-speech-tail {
  left: 50%;
  transform: translateX(-50%) skewX(0deg);
}

.whodunit-alibi-card.speaker-pos-2 .alibi-speech-tail {
  left: 82.5%;
  transform: translateX(-50%) skewX(10deg);
}

.whodunit-alibi-card.alibi-pop {
  animation: alibiPopAnim 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes alibiPopAnim {
  0% { transform: scale(0.98); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.alibi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.alibi-speaker-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.alibi-badge {
  background: var(--safari-green-light);
  color: var(--safari-green-dark);
  border: 1px solid var(--border-color);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.14rem 0.52rem;
  border-radius: 999px;
}

#who-alibi-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--safari-green-dark);
}

.alibi-quote {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.42;
  color: var(--text-main);
  font-style: normal;
}

/* Accusation Area */
.whodunit-accuse-box {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1.5px dashed var(--border-strong);
}

.whodunit-accuse-title {
  margin: 0 0 0.65rem;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--safari-green-dark);
}

.whodunit-accuse-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.who-accuse-btn {
  background: var(--bg-savanna);
  color: var(--text-main);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.68rem 0.55rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.who-accuse-btn:hover {
  border-color: var(--safari-green);
  background: var(--bg-accent-soft);
  transform: translateY(-1px);
}

.who-accuse-btn.accuse-correct {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.who-accuse-btn.accuse-wrong {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
  animation: chipShake 0.4s ease;
}

/* ==========================================================================
   Site Footer ("Designet af Teaching by Straarup")
   ========================================================================== */
.site-footer {
  background: var(--safari-green-dark);
  color: #f4f7f4;
  border-top: 4px solid var(--safari-gold);
  padding: 1.5rem 1.25rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.footer-credits {
  background: rgba(255, 255, 255, 0.12);
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
}

/* ==========================================================================
   Responsive Breakpoints (Computer / Chromebook / iPad / Mobile)
   ========================================================================== */
@media (max-width: 1120px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.5rem 1rem;
  }

  .brand-subtitle {
    white-space: normal;
  }

  .nav-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    scroll-snap-type: x proximity;
  }

  .nav-inner::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: 0 0 auto;
    padding: 0.72rem 0.85rem;
    font-size: 0.86rem;
    scroll-snap-align: start;
  }
}

@media (max-width: 980px) {
  .hero-banner,
  .obstacle-game-layout,
  .missions-split-layout,
  .detective-split-layout,
  .strategies-split-layout,
  .bubble-split-layout,
  .whodunit-split-layout {
    grid-template-columns: 1fr;
  }

  .detective-question-card {
    position: static;
  }

  .mission-numbers-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .strategy-tabs-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .runner-viewport {
    height: 360px;
  }

  .runner-controls-bar {
    gap: 0.85rem;
  }

  .runner-timer-panel {
    max-width: none;
  }
}

@media (max-width: 680px) {
  .three-images-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

  #sent-feedback-bar {
    flex-direction: column;
    align-items: stretch;
  }

  #sent-feedback-bar .primary-btn {
    align-self: stretch;
    text-align: center;
  }

  .activity-header-bar {
    gap: 0.8rem;
    margin-bottom: 1rem;
  }

  .activity-header-bar h2 {
    font-size: 1.38rem;
  }

  .activity-header-bar p {
    font-size: 0.94rem;
  }
}

@media (max-width: 620px) {
  .top-utility-bar {
    padding: 0.4rem max(0.75rem, env(safe-area-inset-right)) 0.4rem max(0.75rem, env(safe-area-inset-left));
  }

  .utility-container {
    justify-content: space-between;
    gap: 0.45rem;
  }

  .main-container {
    padding: 0.75rem max(0.75rem, env(safe-area-inset-right)) 1.8rem max(0.75rem, env(safe-area-inset-left));
  }

  .header-inner {
    padding: 0.5rem max(0.75rem, env(safe-area-inset-right)) 0.5rem max(0.75rem, env(safe-area-inset-left));
    gap: 0.55rem;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-title {
    font-size: 1.32rem;
  }

  .brand-subtitle {
    font-size: 0.74rem;
  }

  .safari-passport {
    padding: 0.28rem 0.62rem;
  }

  .level-selector-panel {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem;
  }

  .level-buttons {
    width: 100%;
  }

  .level-btn {
    flex: 1 1 0;
    padding: 0.35rem 0.3rem;
    gap: 0.25rem;
  }

  .level-animal-wrap {
    height: 24px;
  }

  .level-animal-small,
  .level-animal-medium,
  .level-animal-large {
    height: 22px;
  }

  .level-name {
    font-size: 0.8rem;
  }

  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.8rem 0.95rem;
    gap: 0.75rem;
  }

  .hero-illustration {
    width: 120px;
    align-self: flex-end;
  }

  .runner-viewport {
    height: 320px;
    border-radius: 16px;
    border-width: 3px;
  }

  .runner-hud {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .runner-progress-pill {
    padding: 0.25rem 0.6rem;
    font-size: 0.74rem;
    gap: 0.4rem;
  }

  .runner-mini-bar {
    width: 64px;
  }

  .runner-controls-bar {
    padding: 0.7rem;
    gap: 0.7rem;
  }

  .runner-controls-left {
    width: 100%;
    gap: 0.55rem;
  }

  .runner-keycluster {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.38rem;
  }

  .runner-keycap {
    min-height: 54px;
    padding: 0.35rem 0.25rem;
  }

  .keycap-label {
    font-size: 0.75rem;
  }

  .ctrl-kbd {
    display: none;
  }

  .runner-extra-keys {
    width: 100%;
    flex-direction: row;
    gap: 0.45rem;
  }

  .runner-side-key {
    flex: 1 1 0;
    min-height: 46px;
    justify-content: center;
    padding: 0.42rem 0.65rem;
  }

  .runner-timer-panel {
    min-width: 0;
    max-width: none;
    width: 100%;
    padding: 0.6rem 0.8rem;
  }

  .runner-checkpoint-modal {
    width: 95%;
    top: 38px;
    max-height: calc(100% - 46px);
    padding: 0.8rem 0.85rem;
  }

  .cp-doors-grid,
  .cp-paths-list {
    grid-template-columns: 1fr;
    gap: 0.42rem;
  }

  .cp-door-btn,
  .cp-path-btn {
    flex-direction: row;
    justify-content: space-between;
    padding: 0.52rem 0.75rem;
  }

  .submode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    width: 100%;
  }

  .submode-btn {
    justify-content: center;
    text-align: center;
    padding: 0.5rem 0.45rem;
    font-size: 0.82rem;
  }

  .mission-numbers-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .mission-num-btn {
    height: 38px;
  }

  .items-shelf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .mission-document-card,
  .mission-workspace-card,
  .detective-text-card,
  .detective-question-card,
  .strat-text-card,
  .strat-question-card,
  .bubble-text-card,
  .bubble-arena-card,
  .whodunit-case-card,
  .whodunit-arena-card {
    padding: 0.95rem 0.9rem;
  }

  .workspace-header {
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .strategy-tabs-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .strategy-tabs-row .strat-tab-btn:last-child {
    grid-column: 1 / -1;
  }

  .bubble-stage {
    min-height: 430px;
    padding: 1.05rem 0.7rem 1.15rem;
    gap: 1rem;
    border-radius: 18px;
  }

  .bubble-orbit-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .bubble-orbit-row .orbit-word-chip:nth-child(1),
  .bubble-orbit-row .orbit-word-chip:nth-child(2),
  .bubble-orbit-row .orbit-word-chip:nth-child(3) {
    --arch-y: 0px;
  }

  .bubble-orbit-row .orbit-word-chip:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 240px;
  }

  .orbit-word-chip {
    min-height: 48px;
    padding: 0.48rem 0.65rem;
    font-size: 0.86rem;
  }

  .question-bubble-center {
    width: 96%;
    border-radius: 32px;
    padding: 1rem 0.95rem;
  }

  .bub-corner-mascot,
  .bub-corner-prop-right {
    width: 46px;
    height: 46px;
    opacity: 0.72;
  }

  .whodunit-stage {
    min-height: 210px;
    padding: 0.75rem 0.45rem 0.65rem;
  }

  .whodunit-suspects-row {
    gap: 0.4rem;
  }

  .who-suspect-card {
    padding: 0.4rem 0.25rem 0.45rem;
    border-radius: 13px;
  }

  .who-suspect-figure {
    height: 86px;
  }

  .who-alibi-pill {
    font-size: 0.64rem;
    padding: 0.14rem 0.4rem;
  }

  .whodunit-accuse-buttons {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding: 1.1rem 0.85rem calc(1.1rem + env(safe-area-inset-bottom));
  }

  .footer-inner {
    font-size: 0.84rem;
  }
}

@media (pointer: coarse) {
  .cp-key-btn {
    min-width: 42px;
    height: 40px;
  }

  .mission-pill-btn {
    min-height: 36px;
    padding: 0.35rem 0.72rem;
  }
}
