/* Screen: report — the Annual Report: a big friendly certificate with stars. */

.screen--report.is-rerender {
  animation: none;
}

.rp-paper {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6) var(--sp-6);
  background:
    radial-gradient(600px 220px at 50% -40px, var(--accent-100) 0%, rgba(255, 241, 217, 0) 70%),
    var(--paper);
  border: 3px solid var(--accent-200);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
}

.rp-head {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.rp-trophy {
  position: relative;
  flex: none;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff8e6 0%, var(--accent-200) 70%, var(--accent-400) 100%);
  box-shadow: 0 6px 0 var(--accent-600), var(--shadow-2);
}

.rp-trophy__cup {
  font-size: 54px;
  line-height: 1;
  animation: rp-bounce 900ms var(--ease) 200ms both;
}

.rp-trophy__spark {
  position: absolute;
  font-size: 22px;
  line-height: 1;
  animation: rp-twinkle 1.8s ease-in-out infinite;
}

.rp-trophy__spark--a {
  top: -6px;
  left: -4px;
}

.rp-trophy__spark--b {
  top: -10px;
  right: -8px;
  animation-delay: 400ms;
}

.rp-trophy__spark--c {
  bottom: -4px;
  right: -10px;
  animation-delay: 900ms;
}

@keyframes rp-bounce {
  0% {
    transform: scale(0.3) rotate(-15deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.15) rotate(6deg);
    opacity: 1;
  }
  100% {
    transform: none;
  }
}

@keyframes rp-twinkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.rp-head__text {
  min-width: 0;
}

.rp-title {
  font-size: var(--fs-2xl);
  color: var(--sea-900);
}

.rp-sub {
  font-weight: 700;
  color: var(--ink-soft);
  min-width: 0;
  overflow-wrap: anywhere;
}

.rp-lead {
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: 1.3;
  color: var(--sea-800);
  padding: var(--sp-3) var(--sp-4);
  background: var(--sea-50);
  border-radius: var(--r-md);
  border-left: 6px solid var(--sea-400);
}

/* ── Big number tiles ── */
.rp-tiles {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
}

.rp-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-3) var(--sp-2);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  text-align: center;
}

.rp-tile__emoji {
  font-size: 1.6em;
  line-height: 1;
}

.rp-tile__num {
  font-size: var(--fs-xl);
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.rp-tile.is-money .rp-tile__num {
  color: var(--gain);
}

.rp-tile.is-money.is-neutral .rp-tile__num {
  color: var(--loss);
}

.rp-tile__label {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--ink-soft);
}

/* ── Scorecard ── */
.rp-score {
  padding: var(--sp-4);
  background: var(--card);
  border: 2px solid var(--accent-200);
  border-radius: var(--r-lg);
}

.rp-score__sub {
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
}

.rp-score__list {
  list-style: none;
  padding: 0;
}

.rp-score__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'emoji what stars'
    'emoji note note';
  align-items: center;
  column-gap: var(--sp-3);
  padding: var(--sp-2) 0;
}

.rp-score__row + .rp-score__row {
  border-top: 1px dashed var(--line);
}

.rp-score__emoji {
  grid-area: emoji;
  align-self: start;
  font-size: 1.5em;
  line-height: 1.3;
}

.rp-score__what {
  grid-area: what;
  min-width: 0;
}

.rp-score__label {
  font-weight: 900;
  font-size: var(--fs-md);
}

.rp-score__detail {
  margin: 0 !important;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: var(--fs-sm);
}

.rp-score__stars {
  grid-area: stars;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.rp-stars {
  font-size: 1.7rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.rp-stars__on {
  color: var(--accent-500);
  text-shadow: 0 1px 0 var(--accent-700);
}

.rp-stars__off {
  color: var(--line-strong);
}

.rp-stars__words {
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--ink-soft);
}

.rp-score__note {
  grid-area: note;
  margin: 2px 0 0 !important;
  justify-self: start;
  padding: 0.05em 0.7em;
  border-radius: var(--r-pill);
  background: var(--accent-100);
  color: var(--accent-700);
  font-weight: 800;
  font-size: var(--fs-sm);
}

.rp-score__row.is-none {
  grid-template-areas: 'emoji what stars';
}

.rp-score__note.is-plain {
  grid-area: stars;
  justify-self: end;
  background: var(--sea-50);
  color: var(--ink-soft);
}

/* ── Fact cards ── */
.rp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  align-items: start;
}

.rp-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0;
}

.rp-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.rp-card p + p {
  margin-top: 0;
}

.rp-card__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-md);
}

.rp-best__route {
  font-weight: 800;
}

.rp-worth {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2);
  font-variant-numeric: tabular-nums;
}

.rp-worth__num {
  font-size: var(--fs-lg);
  font-weight: 900;
  color: var(--ink-soft);
}

.rp-worth__num.is-end {
  color: var(--ink);
}

.rp-worth__arrow {
  font-weight: 900;
  color: var(--ink-faint);
}

.rp-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
}

/* Boxes by cargo: emoji + name, a bar, and the number (never the bar alone) */
.rp-bars {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rp-bar {
  display: grid;
  /* em columns grow with big text, so each may shrink (the number column keeps its width) */
  grid-template-columns: minmax(0, 7.5em) minmax(2em, 1fr) minmax(max-content, 5.2em);
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
}

.rp-bar__name {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-bar__emoji {
  font-size: 1.2em;
}

.rp-bar__track {
  height: 16px;
  background: var(--sea-50);
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  overflow: hidden;
}

.rp-bar__fill {
  display: block;
  height: 100%;
  background: var(--sea-500);
  border-radius: 0 4px 4px 0;
  animation: rp-grow 700ms var(--ease) 300ms both;
  transform-origin: left center;
}

@keyframes rp-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: none;
  }
}

.rp-bar__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  white-space: nowrap;
}

.rp-foot {
  display: flex;
  justify-content: center;
  padding-top: var(--sp-2);
}

.rp-foot .btn {
  min-width: min(100%, 320px);
}

/* ── Smaller screens ── */
@media (max-width: 53.75em) {
  .rp-paper {
    padding: var(--sp-5) var(--sp-4);
  }

  .rp-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 37.5em) {
  .rp-paper {
    padding: var(--sp-4) var(--sp-3);
    border-radius: var(--r-lg);
  }

  .rp-trophy {
    width: 68px;
    height: 68px;
  }

  .rp-trophy__cup {
    font-size: 40px;
  }

  .rp-title {
    font-size: var(--fs-xl);
  }

  .rp-lead {
    font-size: var(--fs-md);
  }

  .rp-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rp-tile__num {
    font-size: var(--fs-lg);
  }

  .rp-stars {
    font-size: 1.4rem;
  }

  .rp-bar {
    grid-template-columns: minmax(0, 6.5em) minmax(2em, 1fr) minmax(max-content, 4.8em);
  }

  .rp-foot .btn {
    width: 100%;
  }
}

/* UI-S2: a place she traded, its emoji and its name together ("🌴 Sunrise Isles"). */
.rp-place {
  white-space: nowrap;
}
