/* My Year Wrapped. Calm light app chrome, loud story slides (Lena's sheet, shared/design/E25-year-wrapped-style-and-screens.txt).
   No external fonts or images (CSP: self only), no inline styles anywhere: every dynamic look is a class. */
:root {
  --night: #2A0A66; --end: #A21CAF; --pop: #FFD84D; --bg: #FBF8FF; --ink: #1B0A3D; --muted: #4A3F66; --line: #748A8D; --card: #FFFFFF;
  --focus: #0B57D0; --bad: #B42318; --good: #1F6B40; --good-bg: #E6F4EC;
  --display: "Arial Black", "Segoe UI Black", ui-rounded, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 600 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px; color: var(--ink); }
.skip:focus { left: 8px; z-index: 10; }
.top { background: linear-gradient(135deg, var(--night), var(--end)); color: #fff; }
.top-in { max-width: 960px; margin: 0 auto; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { font: 900 1.3rem/1 var(--display); letter-spacing: -0.02em; }
.tier { font-size: .85rem; border: 2px solid #fff; border-radius: 14px; padding: 0 10px; }
.privacy { max-width: 960px; margin: 0 auto; padding: 8px 16px 0; font-size: .95rem; color: var(--muted); }
.linkbtn { font: inherit; background: none; border: 0; padding: 8px 4px; min-height: 44px; color: var(--focus); text-decoration: underline; cursor: pointer; }
.tabs { max-width: 960px; margin: 0 auto; padding: 4px 16px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 700; min-height: 44px; padding: 8px 16px; border: 2px solid var(--line); border-radius: 22px; background: #fff; color: var(--ink); cursor: pointer; }
.tabs button[aria-current="page"] { background: var(--night); color: #fff; border-color: var(--night); }
main { max-width: 960px; margin: 8px auto 0; padding: 16px; min-height: 50vh; }
main:focus { outline: none; }
h1 { font: 900 1.7rem/1.1 var(--display); letter-spacing: -0.02em; margin: 0 0 8px; color: var(--night); }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 12px 0 4px; }
.lead { font-size: 1.05rem; margin: 0 0 12px; }
.muted { color: var(--muted); font-weight: 500; }
.empty { border: 2px dashed var(--line); border-radius: 16px; padding: 24px 16px; text-align: center; color: var(--muted); }
.card { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 16px; margin: 12px 0; }
.card summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { font: inherit; font-weight: 800; min-height: 44px; padding: 10px 18px; border-radius: 24px; border: 2px solid var(--night); background: var(--night); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.secondary { background: #fff; color: var(--night); }
.btn.small { padding: 6px 14px; }
.btn.big { min-height: 56px; font-size: 1.15rem; padding: 12px 28px; }
.btn.light { background: #fff; color: var(--night); border-color: #fff; }
.btn.danger-outline { background: #fff; color: var(--bad); border-color: var(--bad); }
.field { margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
select, input[type="text"] { font: inherit; min-height: 44px; padding: 8px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; margin-bottom: 8px; }
.check input { width: 24px; height: 24px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tile :focus-visible, .slide :focus-visible, .slide:focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 6px var(--night); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toast { position: fixed; bottom: 12px; left: 12px; right: 12px; max-width: 520px; margin: 0; padding: 8px 14px; background: var(--ink); color: #fff; border-radius: 12px; z-index: 20; }
.toast:empty { display: none; }
.toast.bad { background: var(--bad); }
.foot { max-width: 960px; margin: 0 auto; padding: 12px 16px 80px; color: var(--muted); font-size: .9rem; font-weight: 500; }
.foot p { margin: 4px 0; }
[hidden] { display: none !important; }

/* source colours: tiles and slides */
.th-spotify { --accent: #FFD84D; background: linear-gradient(135deg, #2A0A66, #C2185B); }
.th-netflix { --accent: #FFD84D; background: linear-gradient(135deg, #4A0A12, #B3361B); }
.th-goodreads { --accent: #FFE9A8; background: linear-gradient(135deg, #06352B, #167A51); }
.th-youtube { --accent: #7DF9FF; background: linear-gradient(135deg, #0A1E55, #1D5FD6); }
.th-strava { --accent: #FFE066; background: linear-gradient(135deg, #4D1A00, #B23A0A); }
.th-bank { --accent: #FFF3A3; background: linear-gradient(135deg, #1E0A47, #0E7C86); }
.th-all { --accent: #FFD84D; background: linear-gradient(135deg, #2A0A66, #A21CAF); }
.slide.look-sunset { --accent: #FFD84D; background: linear-gradient(135deg, #4D0A2B, #C2410C); }
.slide.look-mint { --accent: #9CFFD9; background: linear-gradient(135deg, #04201A, #0B6B55); }
.slide.look-mono { --accent: #FFFFFF; background: linear-gradient(135deg, #000000, #3A3A3A); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 12px 0; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { color: #fff; border-radius: 20px; padding: 14px; min-height: 140px; display: flex; flex-direction: column; border: 3px solid transparent; }
.tile.drag { border-color: var(--pop); border-style: dashed; }
.tile.is-locked { filter: saturate(.6); }
.tile-title { font: 900 1.25rem/1.1 var(--display); margin: 0 0 8px; }
.tile-body { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tile-note { margin: 0; font-size: .95rem; font-weight: 600; }
.tile-found { margin: 0; font-weight: 800; }
.tile-error { margin: 0; background: #fff; color: var(--bad); border-radius: 10px; padding: 6px 10px; font-weight: 700; }
.tile-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tile progress { width: 100%; height: 14px; }
.offer { background: #fff; border: 3px solid var(--night); border-radius: 20px; padding: 16px; margin: 12px 0; }
.hide-list { list-style: none; margin: 0; padding: 0; }
.hide-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #D7DCE0; }
.hide-label { overflow-wrap: anywhere; }
.hide-list li.is-hidden .hide-label { text-decoration: line-through; color: var(--muted); }

/* story */
.picker { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.picker .btn[aria-pressed="true"] { background: var(--night); color: #fff; }
.player { max-width: 480px; margin: 0 auto; }
.segs { display: flex; gap: 4px; margin-bottom: 6px; }
.seg { flex: 1; height: 6px; border-radius: 3px; background: #CFC6E6; overflow: hidden; }
.seg.done { background: var(--night); }
.seg.active { background: #CFC6E6; }
.seg i { display: block; height: 100%; width: 0; background: var(--night); }
.player.calm .seg.active { background: var(--night); }
.count { margin: 4px 0; color: var(--muted); font-size: .95rem; text-align: center; }
.slide-wrap { container-type: inline-size; width: min(100%, 480px); margin: 0 auto; aspect-ratio: 9 / 16; position: relative; border-radius: 22px; overflow: hidden; }
.slide { position: absolute; inset: 0; color: #fff; padding: 12cqw 8cqw 14cqw; display: flex; flex-direction: column; justify-content: flex-start; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer; }
.slide-in { position: relative; display: flex; flex-direction: column; gap: 3cqw; }
.blob { position: absolute; border-radius: 50%; background: #fff; opacity: .18; }
.blob.b1 { width: 70cqw; height: 70cqw; right: -20cqw; top: -10cqw; }
.blob.b2 { width: 80cqw; height: 80cqw; left: -30cqw; bottom: -10cqw; }
.s-tag { margin: 0; font-size: max(14px, 3.2cqw); font-weight: 700; }
.s-kicker { margin: 0; font-size: max(16px, 3.7cqw); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.s-hero { margin: 0; font: 900 33cqw/0.95 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.s-hero.text { font-size: 14cqw; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.s-unit { margin: 0; font-size: max(16px, 6.7cqw); font-weight: 700; }
.s-line { margin: 0; font-size: max(16px, 6cqw); font-weight: 600; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.s-sticker { align-self: center; margin: 6cqw 0 0; background: var(--accent); color: var(--night); font: 900 7cqw/1.05 var(--display); padding: 4cqw 6cqw; border-radius: 6cqw; transform: rotate(-4deg); text-align: center; }
.s-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3cqw; }
.s-list li { display: grid; grid-template-columns: 10cqw 1fr auto; gap: 3cqw; align-items: center; }
.s-list .rank { width: 10cqw; height: 10cqw; border-radius: 50%; background: var(--accent); color: var(--night); font: 900 5cqw/10cqw var(--display); text-align: center; }
.s-list .name { font-size: max(16px, 5cqw); font-weight: 800; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.s-list .name small { display: block; font-size: max(14px, 3.6cqw); font-weight: 600; }
.s-list .val { font-size: max(14px, 4cqw); font-weight: 800; text-align: right; }
.s-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.5cqw; align-items: end; height: 46cqw; margin-top: 4cqw; }
.s-bars .col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; align-items: center; }
.s-bars .col span { font-size: max(10px, 2.6cqw); font-weight: 700; margin-top: 1cqw; }
.bar { width: 100%; background: rgba(255,255,255,.85); border-radius: 1.5cqw; min-height: 1cqw; }
.bar.top { background: var(--accent); }
.h-0{height:0}.h-1{height:5%}.h-2{height:10%}.h-3{height:15%}.h-4{height:20%}.h-5{height:25%}.h-6{height:30%}.h-7{height:35%}.h-8{height:40%}.h-9{height:45%}.h-10{height:50%}
.h-11{height:55%}.h-12{height:60%}.h-13{height:65%}.h-14{height:70%}.h-15{height:75%}.h-16{height:80%}.h-17{height:85%}.h-18{height:90%}.h-19{height:95%}.h-20{height:100%}
.controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.controls .btn { min-width: 88px; }

@media (prefers-reduced-motion: no-preference) {
  .slide { animation: slidein .25s ease-out; }
  .s-sticker { animation: pop .25s ease-out; }
  .blob.b1 { animation: drift 12s ease-in-out infinite alternate; }
  .blob.b2 { animation: drift 12s ease-in-out infinite alternate-reverse; }
  .seg.active i.run { animation: fill 6s linear forwards; }
  .player.paused .seg.active i.run { animation-play-state: paused; }
  @keyframes slidein { from { opacity: 0; transform: translateX(3%); } to { opacity: 1; transform: none; } }
  @keyframes pop { from { transform: rotate(-4deg) scale(.6); } to { transform: rotate(-4deg) scale(1); } }
  @keyframes drift { from { transform: translate(0, 0); } to { transform: translate(6cqw, 4cqw); } }
  @keyframes fill { from { width: 0; } to { width: 100%; } }
}
@media (prefers-reduced-motion: reduce) { .seg.active i { width: 100%; } }
@media print { .tabs, .top, .foot, .toast, .privacy, .controls { display: none; } }
