/* =========================================================
   PilotMetrics - Wrapped (/wrapped, scripts/wrapped.js)
   The year's cards in a grid, and the story player.
   ========================================================= */

.wr-years { display: flex; gap: 6px; flex-wrap: wrap; align-self: flex-start; }
.wr-years button { box-shadow: none; }
.wr-years button.active { border-color: var(--line-light); background: var(--line); color: #fff; }

.wr-gate, .wr-empty { text-align: center; padding: 32px 20px; }
.wr-gate h2, .wr-empty h2 { justify-content: center; font-size: 18px; margin: 6px 0 10px; }
.wr-gate .desc, .wr-empty .desc { margin: 0 auto 16px; max-width: 520px; font-size: 13px; line-height: 1.55; }
.wr-gate .desc a { color: var(--text-soft); }
.wr-empty-icon { font-size: 44px; line-height: 1; }

.wr-notice {
  margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; font-size: 12px; line-height: 1.5; color: #e2e8f0;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.16), rgba(6, 182, 212, 0.1)); border: 1px solid rgba(148, 163, 184, 0.4);
}
.wr-notice[hidden] { display: none; }

/* The year, its headline figures and the buttons */
.wr-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.22), transparent 55%),
              radial-gradient(circle at 100% 100%, rgba(6, 182, 212, 0.16), transparent 55%), var(--card);
  border-color: rgba(148, 163, 184, 0.35);
}
.wr-hero-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.wr-hero-year {
  font-size: 64px; font-weight: 900; line-height: 1; letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff, var(--text-soft)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wr-hero-label { font-size: 12px; font-weight: 800; color: var(--muted); }
.wr-hero-figures { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 13px; color: var(--text-soft); }
.wr-hero-figures b { color: #fff; font-size: 17px; }
.wr-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
button.wr-play {
  min-height: 42px; padding: 0 18px; font-size: 14px; font-weight: 800;
  background: linear-gradient(135deg, var(--line-light), var(--line-light));}
button.wr-play:hover { filter: brightness(1.08); }
.wr-roast-btn { border-color: rgba(244, 63, 94, 0.5); }

/* Every card, small */
.wr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.wr-thumb { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wr-thumb-img {
  position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; padding: 0; min-height: 0; border-radius: 12px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line-light); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.wr-thumb-img:hover { transform: translateY(-3px); border-color: var(--line-light); }
.wr-thumb-img img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s ease; }
.wr-thumb.ready img { opacity: 1; }
.wr-thumb-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.wr-thumb.ready .wr-thumb-loading { display: none; }
.wr-thumb figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--text-soft); min-width: 0; }
.wr-thumb figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-thumb figcaption b { color: var(--muted); font-weight: 800; margin-right: 2px; }
.wr-thumb figcaption button { flex: none; min-height: 0; padding: 3px 7px; box-shadow: none; }
.wr-foot { margin-top: 16px; font-size: 12px; line-height: 1.55; }

/* The player: one card at a time, full screen */
body.wr-playing { overflow: hidden; }
.wr-player {
  position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 7, 18, 0.94); backdrop-filter: blur(10px); user-select: none; -webkit-user-select: none;
}
.wr-player[hidden] { display: none; }
.wr-player-inner {
  display: flex; flex-direction: column; gap: 10px; height: 100%; max-height: 100dvh; padding: 12px 16px 14px;
  width: min(100%, calc((100dvh - 150px) * 9 / 16 + 32px));
}
.wr-progress { display: flex; gap: 4px; flex: none; }
.wr-progress span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.wr-progress i { display: block; height: 100%; width: 0; background: #fff; }
.wr-player-top { display: flex; align-items: center; gap: 8px; flex: none; }
.wr-player-title { flex: 1; font-size: 13px; font-weight: 800; color: #fff; }
button.wr-icon-btn {
  min-height: 0; width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 13px; box-shadow: none;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15); color: #fff;
}
button.wr-icon-btn:hover { background: rgba(255, 255, 255, 0.18); }
.wr-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.wr-stage img {
  display: block; max-width: 100%; max-height: 100%; aspect-ratio: 9 / 16; border-radius: 16px; object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); pointer-events: none;
}
.wr-stage img:not([src]) { visibility: hidden; }
.wr-enter { animation: wr-enter 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes wr-enter {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wr-enter { animation: none; }
  .wr-thumb-img { transition: none; }
}
/* Tap the left third for the previous card, the rest for the next */
button.wr-tap { position: absolute; top: 0; bottom: 0; z-index: 1; padding: 0; min-height: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: pointer; }
button.wr-tap:hover { background: transparent; box-shadow: none; }
button.wr-tap:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.5); outline-offset: -4px; }
.wr-tap.prev { left: 0; width: 33%; }
.wr-tap.next { right: 0; width: 67%; }
.wr-player-bottom { display: flex; justify-content: center; flex: none; }
button.wr-share-btn {
  min-height: 42px; padding: 0 22px; font-size: 13px; font-weight: 800; border-radius: 22px;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

@media (max-width: 600px) {
  .wr-hero-year { font-size: 48px; }
  .wr-hero-actions { width: 100%; }
  .wr-hero-actions button { flex: 1 1 auto; }
  .wr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wr-player-inner { width: 100%; padding: 10px 10px 12px; }
}
