/* ==========================================================================
   FlagMap Family (Phase 14) — colourful, exploratory, playful, educational
   Scope: body.kh-scope-flagmap · Routes: /flagmap, /flags, /map, /play,
   /my-world, /passport, /adventures
   ========================================================================== */

/* ---- FlagMap gateway hero ---- */
body.flagmap-background {
  background-color: #dff5ff;
  background-image: var(--flagmap-background-image);
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.flagmap-background #main-content > .container,
body.flagmap-background #main-content > .kh-container {
  background-color: rgba(255, 255, 255, 0.94);
  border-radius: var(--kh-radius-lg);
}

@media (max-width: 991.98px) {
  body.flagmap-background {
    background-attachment: scroll;
    background-size: auto max(100vh, 60rem);
  }
}

@media print {
  body.flagmap-background {
    background-image: none;
    background-color: #fff;
  }
}

.flagmap-hero {
  position: relative;
  text-align: center;
  padding: var(--kh-space-xl) var(--kh-space-md);
  border-radius: var(--kh-radius-xl);
  background:
    radial-gradient(circle at 12% 20%, rgba(56, 163, 165, 0.14), transparent 40%),
    radial-gradient(circle at 88% 80%, rgba(58, 123, 213, 0.12), transparent 42%),
    linear-gradient(180deg, var(--kh-teal-light), var(--kh-bg-soft));
  overflow: hidden;
}

.flagmap-hero__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--kh-font-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--kh-teal-dark);
  line-height: 1.15;
}
.flagmap-hero__brand .flagmap-hero__globe {
  font-size: 0.9em;
  color: var(--kh-explorer);
}

.flagmap-hero__logo {
  width: 3.5rem;
  height: 3.5rem;
  margin-right: 0.45rem;
  border-radius: 1rem;
  object-fit: cover;
  vertical-align: middle;
}

.flagmap-hero__tagline {
  margin-top: var(--kh-space-md);
  font-weight: 800;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  color: var(--kh-text-primary);
  line-height: 1.45;
}
.flagmap-hero__tagline span { display: block; }

/* Logged-out gateway CTAs dominate */
.flagmap-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--kh-space-md);
  margin-top: var(--kh-space-lg);
}

/* Feature preview cards (gateway, logged out) */
.flagmap-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--kh-space-md);
  margin-top: var(--kh-space-xl);
}
.flagmap-feature {
  padding: var(--kh-space-lg);
  border-radius: var(--kh-radius-lg);
  border: 1px solid var(--kh-border);
  background-color: var(--kh-surface);
  box-shadow: var(--kh-shadow-sm);
  text-align: center;
  transition: transform var(--kh-speed) var(--kh-ease), box-shadow var(--kh-speed) var(--kh-ease);
}
.flagmap-feature:hover { transform: translateY(-3px); box-shadow: var(--kh-shadow-md); }
.flagmap-feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: var(--kh-space-sm);
  border-radius: 50%;
  font-size: 1.6rem;
  color: #fff;
}
.flagmap-feature__icon--flags { background-color: var(--kh-teal); }
.flagmap-feature__icon--map { background-color: var(--kh-explorer); }
.flagmap-feature__icon--play { background-color: var(--kh-coral); }
.flagmap-feature__icon--world { background-color: var(--kh-violet); }
.flagmap-feature__title { font-family: var(--kh-font-display); font-weight: 600; font-size: 1.1rem; }
.flagmap-feature__text { color: var(--kh-text-secondary); font-weight: 600; font-size: 0.92rem; margin-top: 0.25rem; }
.flagmap-feature__signin { display: inline-block; margin-top: 0.5rem; font-size: 0.85rem; font-weight: 800; color: var(--kh-explorer-dark); }

.flagmap-hero--public {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border: 1px solid var(--kh-border-soft);
  border-radius: 8px;
  background: #eef9f7;
  box-shadow: var(--kh-shadow-sm);
}
.flagmap-hero--public .flagmap-hero__logo { display: block; width: 5.5rem; height: 5.5rem; margin: 0 auto 0.85rem; }
.flagmap-hero--public .flagmap-hero__brand { display: block; max-width: 45rem; margin: 0 auto; font-size: 2.25rem; }
.flagmap-hero--public .flagmap-hero__tagline { margin: 0.85rem 0 0; font-size: 1rem; }
.flagmap-hero--public .flagmap-hero__tagline span { display: inline; }
.flagmap-hero__intro { max-width: 39rem; margin: 0.75rem auto 0; color: var(--kh-text-secondary); line-height: 1.55; }
.flagmap-public-section { margin-top: 2.75rem; }
.flagmap-public-section h2 { margin: 0 0 0.75rem; font-family: var(--kh-font-display); font-size: 1.7rem; font-weight: 700; color: var(--kh-text-primary); }
.flagmap-public-section__intro { max-width: 49rem; margin: 0 0 1.2rem; color: var(--kh-text-secondary); line-height: 1.6; }
.flagmap-public-section .flagmap-features { margin-top: 0; }
.flagmap-public-section .flagmap-feature { display: flex; flex-direction: column; align-items: flex-start; padding: 1.25rem; border-radius: 8px; text-align: left; }
.flagmap-public-section .flagmap-feature__icon { width: 3rem; height: 3rem; border-radius: 8px; font-size: 1.35rem; }
.flagmap-public-section .flagmap-feature__title { margin: 0 0 0.35rem; }
.flagmap-public-section .flagmap-feature__text { margin: 0; line-height: 1.5; }
.flagmap-public-section .flagmap-feature__signin { margin-top: auto; padding-top: 1rem; }
.flagmap-journey { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; padding: 0; margin: 1.25rem 0 0; list-style: none; }
.flagmap-journey li { min-width: 0; padding: 0.25rem 0.5rem 0.75rem 0; border-bottom: 2px solid var(--kh-border-soft); }
.flagmap-journey__number { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--kh-teal); color: #fff; font-weight: 800; }
.flagmap-journey h3, .flagmap-public-family h3 { margin: 0.75rem 0 0.35rem; font-family: var(--kh-font-display); font-size: 1.1rem; font-weight: 700; }
.flagmap-journey p, .flagmap-public-family p { margin: 0; color: var(--kh-text-secondary); line-height: 1.55; }
.flagmap-public-family__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.flagmap-public-family__grid > div { padding: 0.5rem 1rem; border-left: 2px solid var(--kh-border-soft); }
.flagmap-public-family__grid i { font-size: 1.3rem; color: var(--kh-teal-dark); }
.flagmap-public-family__note { margin-top: 1rem !important; }
.flagmap-public-progress { display: flex; align-items: center; gap: 2rem; padding: 1.25rem 0; border-block: 1px solid var(--kh-border-soft); }
.flagmap-public-progress p { max-width: 52rem; margin: 0; color: var(--kh-text-secondary); line-height: 1.6; }
.flagmap-public-progress > i { margin-left: auto; color: var(--kh-teal-dark); font-size: 2.5rem; }
.flagmap-public-cta { text-align: center; margin-bottom: 1rem; }
.flagmap-public-cta p { margin: 0 auto 1rem; color: var(--kh-text-secondary); }
.flagmap-public-cta__login { margin: 1rem auto 0 !important; }
.flagmap-public-cta__home { margin: 0.35rem auto 0 !important; }
.flagmap-public-cta a:not(.kh-btn) { color: var(--kh-teal-dark); font-weight: 700; }

/* ---- Family Home ---- */
.family-home__greeting { text-align: center; }
.family-home__hello {
  font-family: var(--kh-font-display);
  font-weight: 600;
  font-size: var(--kh-text-page);
  color: var(--kh-text-primary);
}
.family-home__child {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: var(--kh-space-sm);
  padding: 0.55rem 1.1rem;
  border-radius: var(--kh-radius-pill);
  background-color: var(--kh-teal-light);
  color: var(--kh-teal-dark);
  font-weight: 800;
}
.family-home__child small { color: var(--kh-text-secondary); font-weight: 700; }

.family-home__section-label {
  font-family: var(--kh-font-display);
  font-weight: 600;
  font-size: var(--kh-text-section);
  color: var(--kh-text-primary);
  margin-bottom: var(--kh-space-sm);
}

/* Continue Together — the hero action */
.continue-card {
  display: block;
  max-width: 40rem;
  margin: 0 auto;
  padding: var(--kh-space-xl);
  border-radius: var(--kh-radius-xl);
  border: 2px solid var(--kh-teal);
  background: linear-gradient(180deg, var(--kh-teal-light), var(--kh-surface));
  box-shadow: var(--kh-shadow-md);
  text-align: center;
  color: inherit;
  text-decoration: none;
  transition: transform var(--kh-speed) var(--kh-ease), box-shadow var(--kh-speed) var(--kh-ease);
}
.continue-card:hover { transform: translateY(-4px); box-shadow: var(--kh-shadow-lg); color: inherit; }
.continue-card:focus-visible { outline: 3px solid var(--kh-teal); outline-offset: 3px; }
.continue-card__flag { width: min(100%, 15rem); border-radius: var(--kh-radius-md); box-shadow: var(--kh-shadow-sm); }
.continue-card__country { font-family: var(--kh-font-display); font-weight: 700; font-size: 1.6rem; color: var(--kh-teal-dark); margin-top: var(--kh-space-sm); }
.continue-card__hint { color: var(--kh-text-secondary); font-weight: 700; }

/* Quick play row */
.quick-play { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--kh-space-md); }

/* =======================================================================
   Phase 16 — First Adventure and child-to-parent discovery
   ======================================================================= */
.first-adventure-callout {
  max-width: 42rem;
  margin: 0 auto var(--kh-space-xl);
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 2px solid var(--kh-teal);
  border-radius: var(--kh-radius-xl);
  background: radial-gradient(circle at 50% 0, var(--kh-teal-light), transparent 52%), var(--kh-surface);
  box-shadow: var(--kh-shadow-md);
  text-align: center;
}
.first-adventure-callout__icon { display: grid; place-items: center; width: 5rem; height: 5rem; margin: 0 auto 1rem; border-radius: 50%; background: linear-gradient(135deg, var(--kh-teal), var(--kh-explorer)); color: #fff; font-size: 2.35rem; }
.first-adventure-callout h1 { font-family: var(--kh-font-display); font-weight: 600; color: var(--kh-primary); }
.first-adventure-callout p:not(.kh-eyebrow) { color: var(--kh-text-secondary); font-size: 1.05rem; font-weight: 700; }
.first-adventure-callout__steps { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin-top: var(--kh-space-lg); }
.first-adventure-callout__steps span { padding: 0.35rem 0.7rem; border-radius: var(--kh-radius-pill); background-color: var(--kh-primary-light); color: var(--kh-primary-dark); font-size: 0.85rem; font-weight: 800; }
.world-growing-card { display: flex; align-items: center; justify-content: space-between; gap: var(--kh-space-lg); padding: var(--kh-space-lg); border: 1px solid var(--kh-border); border-radius: var(--kh-radius-lg); background-color: var(--kh-surface); box-shadow: var(--kh-shadow-xs); }
.world-growing-card h2 { font-family: var(--kh-font-display); font-size: var(--kh-text-card); font-weight: 600; color: var(--kh-primary); }
.world-growing-card p:not(.kh-eyebrow) { color: var(--kh-text-secondary); font-weight: 600; }
.premium-child-gate { max-width: 40rem; margin: 3rem auto; padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid var(--kh-border); border-radius: var(--kh-radius-xl); background-color: var(--kh-surface); box-shadow: var(--kh-shadow-md); text-align: center; }
.premium-child-gate__icon { display: grid; place-items: center; width: 5rem; height: 5rem; margin: 0 auto 1rem; border-radius: 50%; background-color: var(--kh-primary-light); color: var(--kh-primary); font-size: 2.25rem; }
.premium-child-gate h1 { margin-top: 1rem; font-family: var(--kh-font-display); font-weight: 600; color: var(--kh-primary); }
.premium-child-gate p:not(.kh-eyebrow) { color: var(--kh-text-secondary); font-size: 1.05rem; font-weight: 700; }
.premium-discovery { padding-top: var(--kh-space-lg); border-top: 1px solid var(--kh-border-soft); }
.premium-discovery__heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: var(--kh-space-md); }
.premium-discovery__heading h2 { font-family: var(--kh-font-display); font-size: var(--kh-text-section); font-weight: 600; color: var(--kh-primary); }
.premium-country-card { display: grid; gap: 0.4rem; height: 100%; padding: 0.85rem; border: 1px solid var(--kh-border); border-radius: var(--kh-radius-lg); background-color: var(--kh-surface); color: inherit; text-decoration: none; box-shadow: var(--kh-shadow-xs); }
.premium-country-card:hover { border-color: var(--kh-sunshine); color: inherit; box-shadow: var(--kh-shadow-sm); }
.premium-country-card img { width: 100%; height: 5rem; object-fit: contain; border-radius: var(--kh-radius-sm); background-color: var(--kh-bg-soft); }
.premium-country-card strong { font-family: var(--kh-font-display); font-weight: 600; }
.premium-country-card span { color: var(--kh-sunshine-dark); font-size: 0.8rem; font-weight: 800; }
@media (max-width: 575.98px) { .premium-discovery__heading { align-items: flex-start; flex-direction: column; } }

.first-adventure-page { max-width: 62rem; }
.first-adventure-header { max-width: 44rem; margin: 0 auto var(--kh-space-lg); }
.adventure-steps { display: flex; align-items: center; justify-content: center; gap: 0.45rem; margin-top: var(--kh-space-lg); }
.adventure-step { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--kh-text-secondary); font-size: 0.85rem; font-weight: 800; }
.adventure-step.is-done { color: var(--kh-teal-dark); }
.adventure-step__line { width: clamp(1rem, 7vw, 4rem); height: 2px; background-color: var(--kh-border); }
.adventure-card { max-width: 42rem; margin: 0 auto; padding: clamp(1.25rem, 4vw, 2.5rem); border-radius: var(--kh-radius-xl); background-color: var(--kh-surface); box-shadow: var(--kh-shadow-md); text-align: center; }
.adventure-card--task { border: 1px solid var(--kh-border); }
.adventure-card--complete { border: 2px solid var(--kh-sunshine); background: radial-gradient(circle at 50% 0, #fff7d9, transparent 48%), var(--kh-surface); }
.adventure-kicker { color: var(--kh-teal-dark); font-size: 0.85rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.adventure-card h1 { font-family: var(--kh-font-display); font-size: var(--kh-text-page); font-weight: 600; color: var(--kh-primary); }
.adventure-flag { display: grid; place-items: center; min-height: 12rem; margin: var(--kh-space-lg) auto; padding: 1rem; border-radius: var(--kh-radius-lg); background-color: var(--kh-bg-soft); }
.adventure-flag img { width: min(100%, 21rem); max-height: 13rem; object-fit: contain; border-radius: var(--kh-radius-md); box-shadow: var(--kh-shadow-sm); }
.adventure-choices { display: grid; gap: 0.75rem; max-width: 30rem; margin: var(--kh-space-lg) auto 0; }
.adventure-choices .kh-btn { justify-content: space-between; }
.adventure-choices .small { color: var(--kh-text-secondary); }
.adventure-question-progress { max-width: 34rem; margin: 0 auto 1.25rem; text-align: left; }
.adventure-question-progress__label { margin-bottom: 0.35rem; color: var(--kh-text-secondary); font-size: 0.9rem; font-weight: 800; }
.adventure-question-progress__track { height: 0.55rem; overflow: hidden; border-radius: var(--kh-radius-pill); background: var(--kh-bg-soft); }
.adventure-question-progress__track span { display: block; height: 100%; border-radius: inherit; background: var(--kh-teal); transition: width 180ms ease-out; }
.adventure-help { margin: var(--kh-space-lg) 0 0; color: var(--kh-text-secondary); font-weight: 700; }
.adventure-success { color: var(--kh-success-text); font-weight: 800; }
.adventure-map-visual { display: grid; place-items: center; width: 6rem; height: 6rem; margin: var(--kh-space-lg) auto; border-radius: 50%; background-color: var(--kh-explorer-light); color: var(--kh-explorer-dark); font-size: 2.5rem; }
.adventure-map, #first-adventure-map { min-height: 20rem; margin: var(--kh-space-lg) 0; overflow: hidden; border: 1px solid var(--kh-border); border-radius: var(--kh-radius-lg); box-shadow: var(--kh-shadow-sm); }
.adventure-map .leaflet-container { min-height: 20rem; font-family: var(--kh-font-body); }
#first-adventure-map .leaflet-container { min-height: 20rem; font-family: var(--kh-font-body); }
.capital-reveal { display: grid; gap: 0.25rem; max-width: 22rem; margin: var(--kh-space-lg) auto; padding: var(--kh-space-lg); border: 1.5px solid var(--kh-explorer); border-radius: var(--kh-radius-lg); background-color: var(--kh-explorer-light); color: var(--kh-explorer-dark); }
.capital-reveal i { font-size: 2rem; }
.capital-reveal span { font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.capital-reveal strong { font-family: var(--kh-font-display); font-size: 2rem; font-weight: 700; color: var(--kh-primary); }
.hero-moment-icon { display: grid; place-items: center; width: 5rem; height: 5rem; margin: 0 auto 1rem; border-radius: 50%; background-color: var(--kh-sunshine); color: #5a4306; font-size: 2.35rem; }
.adventure-country { font-family: var(--kh-font-display); font-size: 1.8rem; font-weight: 700; color: var(--kh-teal-dark); }
.adventure-checklist { display: grid; gap: 0.45rem; max-width: 18rem; margin: var(--kh-space-lg) auto; padding: 0; list-style: none; text-align: left; color: var(--kh-success-text); font-weight: 800; }
.adventure-family { color: var(--kh-coral-dark); font-weight: 800; }

/* Parent plan / handoff */
.parent-handoff-page, .parent-plan-page { max-width: 54rem; }
.parent-handoff-card { max-width: 34rem; margin: 3rem auto; padding: clamp(1.5rem, 5vw, 3rem); border: 2px solid var(--kh-primary); border-radius: var(--kh-radius-xl); background-color: var(--kh-surface); box-shadow: var(--kh-shadow-md); text-align: center; }
.parent-handoff-card__icon { display: grid; place-items: center; width: 4.5rem; height: 4.5rem; margin: 0 auto 1rem; border-radius: 50%; background-color: var(--kh-coral-light); color: var(--kh-coral-dark); font-size: 2rem; }
.parent-handoff-card h1, .parent-plan-header h1 { font-family: var(--kh-font-display); font-weight: 600; color: var(--kh-primary); }
.parent-handoff-card p:not(.kh-eyebrow) { color: var(--kh-text-secondary); font-size: 1.05rem; font-weight: 700; }
.parent-plan-header { margin-bottom: var(--kh-space-lg); }
.parent-plan-free, .parent-plan-premium { max-width: 46rem; margin-inline: auto; }
.parent-plan-free h2, .parent-plan-premium h2 { font-family: var(--kh-font-display); font-weight: 600; color: var(--kh-primary); }
.parent-plan-free p, .parent-plan-premium p { color: var(--kh-text-secondary); font-weight: 600; }
.plan-feature-list { display: grid; gap: 0.5rem; padding-left: 1.35rem; color: var(--kh-text-primary); font-weight: 700; }
.plan-feature-list li::marker { color: var(--kh-teal); }

@media (max-width: 575.98px) {
  .world-growing-card { align-items: flex-start; flex-direction: column; }
  .adventure-steps { gap: 0.2rem; font-size: 0.75rem; }
  .adventure-step__line { width: 0.8rem; }
  .adventure-map, .adventure-map .leaflet-container, #first-adventure-map, #first-adventure-map .leaflet-container { min-height: 16rem; }
}

/* ==========================================================================
   Country detail
   ========================================================================== */
.country-title {
  font-family: var(--kh-font-display);
  font-weight: 700;
  font-size: var(--kh-text-hero);
  color: var(--kh-teal-dark);
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

/* Capital City — first-class geography content */
.capital-card {
  max-width: 26rem;
  margin: 0 auto var(--kh-space-lg);
  padding: var(--kh-space-lg);
  text-align: center;
  border-radius: var(--kh-radius-lg);
  border: 1.5px solid var(--kh-explorer);
  background: linear-gradient(180deg, var(--kh-explorer-light), var(--kh-surface));
  box-shadow: var(--kh-shadow-sm);
}
.capital-card__label {
  color: var(--kh-explorer-dark);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.capital-card__name {
  font-family: var(--kh-font-display);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--kh-text-primary);
  margin-bottom: 0.1rem;
}

/* Our Progress checklist */
.country-progress-panel {
  max-width: 28rem;
  margin: 0 auto;
  padding: var(--kh-space-lg);
  border-radius: var(--kh-radius-lg);
  background-color: var(--kh-teal-light);
  text-align: center;
}
.country-progress-panel__label {
  color: var(--kh-teal-dark);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.country-checklist {
  list-style: none;
  padding: 0;
  margin: 0.5rem auto 0;
  max-width: 16rem;
  text-align: left;
}
.country-checklist li {
  padding: 0.4rem 0;
  font-weight: 700;
  color: var(--kh-text-secondary);
}
.country-checklist li.is-done { color: var(--kh-success-text); }
.country-checklist li.is-done i { color: var(--kh-leaf); }
.country-checklist li i { color: #b6c2cd; }

/* 195-country browser cards: stable dimensions prevent layout shift. */
.flag-card--polished {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform var(--kh-speed) var(--kh-ease), box-shadow var(--kh-speed) var(--kh-ease), border-color var(--kh-speed) var(--kh-ease);
}
.flag-card--polished:hover { transform: translateY(-3px); border-color: var(--kh-teal); box-shadow: var(--kh-shadow-md); }
.flag-card--polished .flag-card__image-wrap { flex: 0 0 9rem; }
.flag-card--polished h2 { font-family: var(--kh-font-display); font-weight: 600; }
.flag-card--polished p { min-height: 1.6rem; }
.flag-card--polished .kh-btn { margin-top: auto; }

/* ==========================================================================
   Game tiles (grouped hub) + active game focus
   ========================================================================== */
.game-tile {
  display: grid;
  gap: 0.3rem;
  align-content: start;
  height: 100%;
  padding: var(--kh-space-lg);
  border: 1px solid var(--kh-border);
  border-radius: var(--kh-radius-lg);
  background-color: var(--kh-surface);
  box-shadow: var(--kh-shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: transform var(--kh-speed) var(--kh-ease), box-shadow var(--kh-speed) var(--kh-ease), border-color var(--kh-speed) var(--kh-ease);
}
.game-tile:hover { transform: translateY(-3px); box-shadow: var(--kh-shadow-md); border-color: var(--kh-teal); color: inherit; }
.game-tile:focus-visible { outline: 3px solid var(--kh-teal); outline-offset: 3px; }
.game-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.4rem;
  color: #fff;
}
.game-tile__icon--flags { background-color: var(--kh-teal); }
.game-tile__icon--map { background-color: var(--kh-explorer); }
.game-tile__icon--play { background-color: var(--kh-coral); }
.game-tile__icon--world { background-color: var(--kh-violet); }
.game-tile__title { font-family: var(--kh-font-display); font-weight: 600; font-size: 1.05rem; }
.game-tile__text { color: var(--kh-text-secondary); font-weight: 600; font-size: 0.9rem; }

/* Active game screen: reduce clutter, focus one task */
.game-round-card {
  border: 1px solid var(--kh-border-soft);
}
.game-choice {
  min-height: var(--kh-touch);
  font-weight: 800;
}
body[data-age="little_explorer"] .game-round-card { padding: var(--kh-space-lg) var(--kh-space-sm); }

/* =======================================================================
   Family multiplayer: focused, shared-device game surface
   ======================================================================= */
.flagmap-multiplayer-page {
  min-height: 100%;
  padding: clamp(1rem, 3vw, 2.5rem) 1rem 3rem;
  background: transparent;
}
.multiplayer-shell { width: min(100%, 64rem); margin: 0 auto; }
.multiplayer-room-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--kh-border);
  border-radius: var(--kh-radius-lg);
  background: var(--kh-surface);
  box-shadow: var(--kh-shadow-sm);
}
.multiplayer-room-header h1, .multiplayer-completion__title { margin: 0.2rem 0 0; color: var(--kh-primary); font-family: var(--kh-font-display); font-weight: 600; }
.multiplayer-eyebrow, .multiplayer-section-label {
  margin: 0;
  color: var(--kh-teal-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.multiplayer-status {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--kh-border);
  border-radius: var(--kh-radius-pill);
  background: var(--kh-primary-light);
  color: var(--kh-primary-dark);
  font-size: 0.82rem;
  font-weight: 800;
}
.multiplayer-status--active { background: var(--kh-teal-light); color: var(--kh-teal-dark); }
.multiplayer-status--completed { background: var(--kh-success-bg); color: var(--kh-success-text); }
.multiplayer-panel { margin-top: 1rem; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--kh-border); border-radius: var(--kh-radius-lg); background: var(--kh-surface); box-shadow: var(--kh-shadow-xs); }
.multiplayer-panel__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.multiplayer-panel__heading h2, .multiplayer-section-title { margin: 0; color: var(--kh-primary); font-family: var(--kh-font-display); font-size: var(--kh-text-card); font-weight: 600; }
.multiplayer-panel__heading span, .multiplayer-helper { color: var(--kh-text-secondary); font-size: var(--kh-text-small); font-weight: 600; }
.multiplayer-participants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.multiplayer-participant { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-width: 0; padding: 0.9rem 1rem; border: 1px solid var(--kh-border-soft); border-radius: var(--kh-radius-md); background: var(--kh-bg-soft); }
.multiplayer-participant__identity { display: grid; gap: 0.15rem; min-width: 0; }
.multiplayer-participant__name { overflow: hidden; color: var(--kh-text-primary); text-overflow: ellipsis; white-space: nowrap; }
.multiplayer-participant__role, .multiplayer-participant__state { color: var(--kh-text-secondary); font-size: 0.82rem; font-weight: 700; }
.multiplayer-participant__state { text-align: right; }
.multiplayer-participant__state.is-ready { color: var(--kh-success-text); }
.multiplayer-config { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.multiplayer-round-options, .multiplayer-targets, .multiplayer-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.multiplayer-round-options .btn { min-width: 3.7rem; }
.multiplayer-primary-action { min-width: 8rem; }
.multiplayer-progress { display: grid; gap: 0.5rem; margin-bottom: 1.25rem; }
.multiplayer-progress__heading { color: var(--kh-primary); font-weight: 800; }
.multiplayer-progress__track { height: 0.45rem; overflow: hidden; border-radius: var(--kh-radius-pill); background: var(--kh-border-soft); }
.multiplayer-progress__bar { height: 100%; border-radius: inherit; background: var(--kh-teal); transition: width 180ms ease; }
.multiplayer-progress__status { color: var(--kh-text-secondary); font-size: 0.82rem; font-weight: 700; }
.multiplayer-question { display: grid; justify-items: center; gap: 0.75rem; margin-bottom: 1.25rem; text-align: center; }
.multiplayer-question__title { max-width: 42rem; margin: 0; color: var(--kh-primary); font-family: var(--kh-font-display); font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 600; }
.multiplayer-question__flag { width: auto; max-width: min(100%, 18rem); max-height: 8rem; object-fit: contain; border-radius: var(--kh-radius-sm); box-shadow: var(--kh-shadow-sm); }
.multiplayer-map { position: relative; width: min(100%, 42rem); border: 1px solid var(--kh-border); border-radius: var(--kh-radius-md); background: var(--kh-bg-soft); }
.multiplayer-map__viewport { width: 100%; aspect-ratio: 2 / 1; overflow: hidden; touch-action: pan-y; cursor: grab; }
.multiplayer-map__viewport.is-zoomed { touch-action: none; }
.multiplayer-map__viewport:active { cursor: grabbing; }
.multiplayer-map__transform { width: 100%; height: 100%; transform-origin: center; will-change: transform; }
.multiplayer-map svg { display: block; width: 100%; height: 100%; }
.multiplayer-map__controls { position: absolute; top: 0.55rem; right: 0.55rem; z-index: 2; display: flex; gap: 0.35rem; padding: 0.3rem; border: 1px solid var(--kh-border); border-radius: var(--kh-radius-md); background: rgba(255, 255, 255, 0.94); box-shadow: var(--kh-shadow-xs); }
.multiplayer-map__control { min-width: 2.75rem; min-height: var(--kh-touch); }
.multiplayer-answer-section, .multiplayer-host-answer, .multiplayer-reveal, .multiplayer-next-round, .multiplayer-lobby { display: grid; gap: 0.8rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--kh-border-soft); }
.multiplayer-host-answer { padding: 1rem; border: 1px solid var(--kh-primary-light); border-radius: var(--kh-radius-md); background: var(--kh-primary-light); }
.multiplayer-answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.multiplayer-answer-card { display: grid; place-items: center; width: 100%; min-height: 5.5rem; padding: 0.75rem; border: 1px solid var(--kh-border); border-radius: var(--kh-radius-md); background: var(--kh-surface); color: var(--kh-text-primary); font-weight: 800; transition: border-color var(--kh-speed) var(--kh-ease), box-shadow var(--kh-speed) var(--kh-ease), transform var(--kh-speed) var(--kh-ease); }
.multiplayer-answer-card:hover, .multiplayer-answer-card:focus-visible { border-color: var(--kh-teal); box-shadow: var(--kh-shadow-sm); transform: translateY(-1px); }
.multiplayer-answer-card__flag { display: block; width: auto; max-width: 100%; height: auto; max-height: 7.5rem; object-fit: contain; }
.multiplayer-answer-card__text { padding: 0.7rem; text-align: center; }
.multiplayer-secondary-action { justify-self: start; }
.multiplayer-reveal { padding: 1.25rem; border: 1px solid var(--kh-teal); border-radius: var(--kh-radius-md); background: var(--kh-teal-light); }
.multiplayer-reveal.is-incomplete { border-color: var(--kh-border); background: var(--kh-bg-soft); }
.multiplayer-reveal__title { margin: 0; color: var(--kh-primary); font-family: var(--kh-font-display); font-size: 1.35rem; }
.multiplayer-reveal__answer { margin: 0; color: var(--kh-teal-dark); font-weight: 800; }
.multiplayer-answer-result { margin: 0; padding-top: 0.55rem; border-top: 1px solid rgba(36, 49, 66, 0.1); color: var(--kh-text-primary); font-size: 0.92rem; font-weight: 700; }
.multiplayer-ready-note { margin: 0; color: var(--kh-success-text); font-weight: 800; }
.multiplayer-completion { display: grid; gap: 1rem; text-align: center; }
.multiplayer-completion__lead { margin: 0; color: var(--kh-text-secondary); font-weight: 700; }
.multiplayer-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.multiplayer-metric { display: grid; gap: 0.25rem; padding: 1rem; border: 1px solid var(--kh-border-soft); border-radius: var(--kh-radius-md); background: var(--kh-bg-soft); }
.multiplayer-metric__label { color: var(--kh-text-secondary); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.multiplayer-metric__value { color: var(--kh-primary); font-family: var(--kh-font-display); font-size: 1.5rem; }
.multiplayer-summary-list { display: grid; gap: 0.5rem; text-align: left; }
.multiplayer-summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--kh-border-soft); }
.multiplayer-summary-row span { color: var(--kh-text-secondary); font-size: 0.9rem; font-weight: 700; text-align: right; }
.multiplayer-error:empty { display: none; }
.multiplayer-error { margin-top: 1rem; padding: 0.8rem 1rem; border: 1px solid var(--kh-coral); border-radius: var(--kh-radius-md); background: var(--kh-coral-light); color: var(--kh-coral-dark); font-size: 0.9rem; font-weight: 700; }
.multiplayer-end-action { display: block; margin: 1.5rem 0 0 auto; }
.end-session-dialog { max-width: 26rem; width: calc(100% - 2rem); padding: 1.5rem; border: 1px solid var(--kh-border-soft); border-radius: var(--kh-radius-md); box-shadow: var(--kh-shadow-sm); }
.end-session-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.end-session-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
@media (max-width: 575.98px) {
  .multiplayer-room-header, .multiplayer-panel__heading { align-items: flex-start; flex-direction: column; }
  .multiplayer-participants, .multiplayer-answer-grid { grid-template-columns: 1fr; }
  .multiplayer-participant { align-items: flex-start; flex-direction: column; }
  .multiplayer-participant__state { text-align: left; }
  .multiplayer-summary-row { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .multiplayer-summary-row span { text-align: left; }
  .multiplayer-map__controls { max-width: calc(100% - 1rem); flex-wrap: wrap; justify-content: flex-end; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991.98px) {
  .flagmap-features { grid-template-columns: repeat(2, 1fr); }
  .flagmap-journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .flagmap-public-family__grid { grid-template-columns: 1fr; gap: 0.75rem; }
}
@media (max-width: 575.98px) {
  .flagmap-features { grid-template-columns: 1fr; }
  .flagmap-journey { grid-template-columns: 1fr; gap: 0.75rem; }
  .flagmap-hero--public { padding: 1.5rem 1rem; }
  .flagmap-hero--public .flagmap-hero__brand { font-size: 1.7rem; }
  .flagmap-hero--public .flagmap-hero__ctas { gap: 0.75rem; }
  .flagmap-public-section { margin-top: 2.25rem; }
  .flagmap-public-progress > i { display: none; }
  .quick-play { grid-template-columns: 1fr; }
  .flagmap-hero { padding: var(--kh-space-lg) var(--kh-space-sm); }
}
