/* Mobile ending recap: shared screen structure in a single, native-scroll column. */
:root {
  --phone-ending-surface: rgba(15, 30, 20, .8);
  --phone-ending-border: rgba(255, 255, 255, .12);
  --phone-ending-green: rgba(143, 214, 148, .26);
  --phone-ending-gold: #e2c06b;
  --phone-ending-ivory: #f1f5f9;
}
.end-scene {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top, 24px)) 16px max(24px, env(safe-area-inset-bottom, 24px));
  overscroll-behavior: contain;
}
.end-scene__content {
  width: min(100%, 440px);
  min-height: 0;
  max-height: calc(100vh - max(24px, env(safe-area-inset-top, 24px)) - max(24px, env(safe-area-inset-bottom, 24px)));
  max-height: calc(100svh - max(24px, env(safe-area-inset-top, 24px)) - max(24px, env(safe-area-inset-bottom, 24px)));
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top, 24px)) - max(24px, env(safe-area-inset-bottom, 24px)));
  margin-block: auto;
  padding: 22px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid var(--phone-ending-border);
  border-radius: 20px;
  background: var(--phone-ending-surface);
  box-shadow: 0 24px 48px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 214, 148, .62) transparent;
  text-align: center;
}
.end-scene__content::-webkit-scrollbar { width: 6px; }
.end-scene__content::-webkit-scrollbar-track { background: transparent; }
.end-scene__content::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(143, 214, 148, .62); }
.end-scene__header { margin: 0 auto 14px; padding: 0; }
.end-scene__content .end-scene__title {
  margin: 0 0 8px;
  color: #e4f3cc;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  font-weight: 650;
  line-height: 1.18;
  text-shadow: none;
}
.end-scene__lore {
  width: 90%;
  max-width: 90%;
  margin: 0 auto;
  color: var(--phone-ending-ivory);
  font-size: clamp(.9rem, 3.7vw, .95rem);
  line-height: 1.5;
  white-space: pre-line;
  text-shadow: none;
}
.ending-summary-reveal {
  display: grid;
  grid-template-rows: minmax(0, 0fr);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: grid-template-rows .48s ease-in-out, opacity .3s ease-in-out;
}
.ending-summary-reveal.is-visible {
  grid-template-rows: minmax(0, 1fr);
  opacity: 1;
  pointer-events: auto;
}
.ending-summary-reveal__inner { min-height: 0; }
.end-scene__content .ending-summary--detailed {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-align: left;
}
.ending-summary__section-heading { margin: 0 0 10px; padding: 0; text-align: left; }
.ending-summary__recap-title {
  margin: 0;
  color: var(--phone-ending-gold);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .09em;
  line-height: 1.3;
  text-transform: uppercase;
}
.summary-bullets { margin: 0 0 14px; }
.summary-bullets__title,
.stats-kpi__title,
.ending-summary__title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.3;
  text-align: left;
}
.summary-bullets__list,
.seasons-grid__events { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.summary-bullets__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: var(--phone-ending-ivory);
  font-size: .85rem;
  text-align: left;
}
.summary-bullets__icon { flex: 0 0 auto; font-size: 1.1rem; }
.summary-bullets__copy { display: grid; gap: 2px; min-width: 0; }
.summary-bullets__item-title { color: #fff8e8; font-weight: 700; }
.summary-bullets__item-description { color: var(--phone-ending-ivory); }
.summary-bullets__empty {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: rgba(241, 245, 249, .72);
  font-size: .85rem;
  text-align: left;
}
.stats-kpi { margin: 0 0 14px; }
.stats-kpi__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats-kpi__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--phone-ending-green);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  text-align: left;
}
.stats-kpi__label { min-width: 0; margin: 0; color: var(--phone-ending-ivory); font-size: .78rem; font-weight: 700; line-height: 1.2; }
.stats-kpi__value { color: #fff8e8; font-size: 1.02rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-kpi__track {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(2, 12, 8, .78);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .42);
}
.stats-kpi__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, #a8e063);
  transition: width .7s cubic-bezier(.22, .61, .36, 1);
}
[data-stat="cooperacion"] .stats-kpi__fill { background: #6dd5fa; }
.ending-summary__milestones { margin: 0; }
.seasons-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.seasons-grid__card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(143, 214, 148, .2);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  text-align: left;
}
.seasons-grid__heading { margin: 0 0 8px; color: #e4f3cc; font-size: .9rem; font-weight: 750; line-height: 1.3; }
.seasons-grid__events { gap: 6px; }
.seasons-grid__event { display: flex; align-items: flex-start; gap: 8px; color: var(--phone-ending-ivory); font-size: .84rem; line-height: 1.35; }
.seasons-grid__event-icon { flex: 0 0 auto; }
.seasons-grid__event-label { min-width: 0; }
.seasons-grid__empty { color: rgba(241, 245, 249, .68); font-size: .82rem; font-style: italic; }
.ending-summary__footer { display: flex; justify-content: center; margin-top: 24px; }
.ending-summary__footer .button--language { width: min(100%, 360px); min-height: 52px; }
.ending-summary--detailed .language-transition,
.ending-summary--detailed .language-transition * { transition: opacity .22s ease-in-out, min-height .32s ease-in-out; }
@media (max-width: 360px) {
  .end-scene { padding-inline: 10px; }
  .end-scene__content { padding-inline: 12px; }
  .stats-kpi__grid { gap: 6px; }
  .stats-kpi__card { grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 9px; }
  .stats-kpi__value { font-size: .98rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ending-summary-reveal,
  .ending-summary--detailed *,
  .stats-kpi__fill,
  .end-scene__content { transition: none; animation: none; }
}
