/* Tus resúmenes y la historia del año. */

.recap-screen {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: var(--stage);
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(var(--safe-t) + 14px) calc(var(--gutter) + var(--safe-r)) calc(30px + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
  transition: transform 300ms cubic-bezier(0.2, 0.9, 0.25, 1), opacity 200ms ease;
}

.recap-screen.closed {
  transform: translateX(104%);
  pointer-events: none;
}

.recap-top {
  max-width: 1100px;
  margin: 0 auto 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recap-top .back {
  align-self: flex-start;
  margin-bottom: -4px;
}

.recap-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recap-title {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.recap-title b {
  display: block;
  font-stretch: 82%;
  font-weight: 800;
  font-size: 22px;
  line-height: 1.15;
}

.recap-title span {
  color: var(--ink-muted);
  font-size: 13px;
}

.recap-screen .empty {
  margin-top: 4vh;
}

.year-locked .countdown {
  font-size: 120px;
  font-weight: 900;
  line-height: 1;
  color: var(--lit);
  letter-spacing: -0.04em;
}

.recap-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

html.wide .recap-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.recap-grid .card {
  margin: 0;
}

html.wide .recap-grid .hero,
html.wide .recap-grid .stat-tiles {
  grid-column: 1 / -1;
}

.big-number {
  font-weight: 900;
  font-size: clamp(64px, 16vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--lit);
}

.hero-label {
  font-stretch: 82%;
  font-weight: 800;
  font-size: 24px;
  margin-top: 4px;
}

.hero .btn {
  margin-top: 14px;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.stat-tile {
  border-radius: var(--r-panel);
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-tile b {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.05;
}

.stat-tile span {
  color: var(--ink-muted);
  font-size: 13px;
}

.bars {
  display: flex;
  align-items: stretch;
  gap: 8px;
  height: 160px;
  margin-top: 16px;
}

.bars.dense {
  gap: 3px;
}

.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.bar i {
  display: block;
  width: 100%;
  border-radius: 6px 6px 3px 3px;
  background: color-mix(in srgb, var(--lit) 45%, var(--surface-highest));
}

.bar.today i {
  background: var(--lit);
}

.bar span {
  font-size: 11.5px;
  color: var(--ink-muted);
  height: 14px;
  font-variant-numeric: tabular-nums;
}

.rank {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: var(--r-control);
  cursor: pointer;
}

.rank-row:hover {
  background: var(--surface-high);
}

.rank-row .n {
  width: 28px;
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  color: var(--lit);
  flex: none;
}

.rank-row .meta {
  flex: 1;
  min-width: 0;
}

.rank-row .t {
  font-weight: 600;
  font-size: 15.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-row .a {
  color: var(--ink-muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.genres {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.genre {
  display: grid;
  grid-template-columns: minmax(80px, 34%) 1fr 30px;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.genre span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.genre em {
  font-style: normal;
  color: var(--ink-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.gbar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-highest);
  overflow: hidden;
}

.gbar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--lit);
}

.facts {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  font-size: 14.5px;
}

.facts dt {
  color: var(--ink-muted);
}

.facts dd {
  margin: 0;
  font-weight: 600;
}

.facts dd::first-letter {
  text-transform: uppercase;
}

/* Historia del año */
.story {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--stage);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  user-select: none;
  animation: fade 200ms ease;
}

.story .p-horizon {
  background: linear-gradient(to bottom, transparent 5%, rgba(var(--c2-rgb), 0.14) 22%, rgba(var(--c1-rgb), 0.3) 32%, rgba(var(--c2-rgb), 0.1) 42%, transparent 60%);
}

.story-bars {
  display: flex;
  gap: 5px;
  padding: calc(var(--safe-t) + 12px) 16px 0;
  position: relative;
  z-index: 2;
}

.story-bars i {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 25%, transparent);
  overflow: hidden;
}

.story-bars i b {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
}

.story-bars i.done b {
  width: 100%;
}

.story-bars i.now b {
  animation: storybar 6500ms linear forwards;
}

@keyframes storybar {
  to {
    width: 100%;
  }
}

.story .story-close {
  position: absolute;
  top: calc(var(--safe-t) + 22px);
  right: 10px;
  z-index: 3;
}

.story-stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px calc(28px + var(--safe-r)) calc(30px + var(--safe-b)) calc(28px + var(--safe-l));
  position: relative;
  z-index: 1;
}

.story-slide {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: rise 360ms cubic-bezier(0.2, 0.9, 0.25, 1);
}

.story-slide small {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-muted);
}

.story-slide h2 {
  margin: 0;
  font-weight: 900;
  font-size: 40px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  word-break: break-word;
}

.story-slide .huge {
  font-size: clamp(44px, 11vw, 92px);
}

.story-slide .mega {
  font-weight: 900;
  font-size: clamp(80px, 24vw, 200px);
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.story-slide .lit {
  color: var(--lit);
}

.story-slide p {
  margin: 0;
  font-size: 18px;
  color: var(--ink-muted);
}

.story-cover {
  width: min(62vw, 300px);
  aspect-ratio: 1;
  border-radius: var(--r-panel);
  background: linear-gradient(135deg, rgba(var(--c1-rgb), 0.75), rgba(var(--c2-rgb), 0.45)) center / cover;
  display: grid;
  place-items: center;
  font-stretch: 82%;
  font-weight: 900;
  font-size: 80px;
  color: #fff;
  box-shadow: var(--shadow);
}

.story-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.story-list li {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.story-list li > b {
  font-size: 40px;
  font-weight: 900;
  width: 34px;
  flex: none;
}

.story-list li .display {
  font-size: clamp(26px, 6vw, 40px);
  font-weight: 800;
  line-height: 1.05;
}

.story-list li span {
  color: var(--ink-muted);
  font-size: 15px;
}

.story-actions {
  margin-top: 10px;
}

/* Consejo para iPhone */
.ios-tip {
  border-color: rgba(var(--c1-rgb), 0.45);
}

.story .p-horizon {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
