@font-face {
  font-family: Bungee;
  src: url('/static/wrapped/fonts/bungee-latin.woff2') format('woff2');
  font-display: swap;
  font-weight: 400;
}
@font-face {
  font-family: Manrope;
  src: url('/static/wrapped/fonts/manrope-latin.woff2') format('woff2');
  font-display: swap;
  font-weight: 200 800;
}
:root {
  font-family: Manrope, Arial, sans-serif;
  font-synthesis: none;
  color: #1f1933;
  background: #1f1933;
  --yellow: #ffd84d;
  --purple: #613bde;
  --blue: #bde7f2;
  --ink: #1f1933;
  --cream: #fff4da;
  --scene: var(--yellow);
  --text: var(--ink);
  --accent: var(--purple);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a, select, summary { touch-action: manipulation; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
a { color: inherit; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.experience {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  height: 100dvh;
  min-height: 360px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 24px max(10px, env(safe-area-inset-bottom));
  overflow: hidden;
  color: var(--text);
  background: var(--scene);
  transition: background-color .3s, color .3s;
}
.experience[data-theme='purple'] { --scene: var(--purple); --text: var(--cream); --accent: var(--yellow); }
.experience[data-theme='blue'] { --scene: var(--blue); --text: var(--ink); --accent: var(--purple); }
.experience[data-theme='ink'] { --scene: var(--ink); --text: var(--cream); --accent: var(--yellow); }
.experience::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
}
.experience[data-scenery='horizon']::before {
  background: linear-gradient(180deg, #ffd84d 22%, #ffd84de8 40%, #ffd84d33 76%, #ffd84dcf 100%), url('/static/wrapped/forestry.png') 55% 78% / auto 75% no-repeat;
  opacity: 1;
}
.experience[data-scenery='forest']::before {
  background: linear-gradient(180deg, #1f1933db, #1f19338a 55%, #1f1933eb), url('/static/wrapped/forestry.png') 52% center / cover;
  opacity: 1;
}
.experience[data-theme='yellow'][data-scenery='forest']::before {
  background: linear-gradient(180deg, #ffd84d 24%, #ffd84de8 50%, #ffd84d66 82%, #ffd84de8), url('/static/wrapped/forestry.png') 60% bottom / auto 65% no-repeat;
}
.experience[data-scenery='stone']::before {
  background: url('/static/wrapped/gielinor.jpg') center / cover;
  mix-blend-mode: multiply;
  opacity: .25;
}
.masthead {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-height: 44px;
}
.brand { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 800; text-decoration: none; }
.brand img { width: 27px; height: 27px; border-radius: 50%; background: var(--cream); }
.brand b { display: block; font-size: 8px; letter-spacing: .07em; margin-top: 2px; }
.exit-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 10px; font-weight: 800; text-decoration: none; }
.exit-link span { font-size: 21px; }
.progress-track { display: flex; align-items: center; gap: 5px; flex-shrink: 0; height: 20px; }
.progress-segment { position: relative; height: 3px; flex: 1; overflow: hidden; background: color-mix(in srgb, currentColor 18%, transparent); }
.progress-segment span { position: absolute; inset: 0; background: currentColor; transform: scaleX(0); transform-origin: left; }
.stage { display: flex; flex: 1; min-height: 0; position: relative; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.stage details, .stage input { -webkit-user-select: text; user-select: text; }
.scene {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  padding: 16px 0 4px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  animation: scene-in .4s ease both;
}
.scene-body { display: flex; flex: 1 0 auto; flex-direction: column; justify-content: center; position: relative; padding: 15px 0 32px; }
.player-name { margin: 0 0 16px; font-size: clamp(19px, 6vw, 29px); font-weight: 800; letter-spacing: -.045em; overflow-wrap: anywhere; }
.edition-label { align-self: flex-start; margin: 0 0 18px; padding: 4px 9px; border: 1px solid currentColor; font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.wrapped-title, .state-title, .summary-title, .fact-value, .fact-label, .chart-title {
  font-family: Bungee, 'Arial Black', Impact, sans-serif;
  font-weight: 400;
  white-space: pre-line;
  overflow-wrap: anywhere;
  letter-spacing: -.055em;
}
.wrapped-title { font-size: clamp(84px, 25vw, 122px); line-height: .9; margin: 0 0 25px; transform: rotate(-5deg); transform-origin: left center; }
.personal-line { font-size: clamp(17px, 4.8vw, 23px); line-height: 1.4; letter-spacing: -.035em; font-weight: 800; max-width: 340px; margin: 25px 0 0; text-wrap: pretty; }
.scene-intro .personal-line, .scene-sparse .personal-line { max-width: 295px; margin-top: 10px; }
.story-fact { display: flex; flex-direction: column; margin: 0; }
.fact-value { font-size: clamp(74px, 22vw, 112px); line-height: 1.05; color: var(--accent); }
.fact-label { font-size: clamp(23px, 6.6vw, 34px); line-height: 1.2; margin-top: 16px; max-width: 100%; }
.story-skill { width: 65px; height: 65px; image-rendering: pixelated; object-fit: contain; margin: 0 0 30px auto; transform: rotate(12deg); filter: drop-shadow(4px 5px 0 #1f193326); }
.scene-next_level .story-skill { margin-bottom: 22px; }
.scene-rhythm .fact-value { font-size: clamp(47px, 14vw, 78px); }
.scene-focus .personal-line, .scene-combat_99 .personal-line, .scene-capes .personal-line { max-width: 330px; }
.sparse-copy { font-size: 12px; font-weight: 600; line-height: 1.6; max-width: 300px; margin: 14px 0 0; }
.primary-action, .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 48px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--cream);
  background: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: none;
}
.primary-action:hover { background: var(--purple); border-color: var(--purple); }
.secondary-action { color: var(--ink); background: transparent; }
.measurement-details { margin-top: 6px; flex-shrink: 0; font-size: 11px; line-height: 1.6; }
.measurement-details summary, .chart-details summary { display: list-item; min-height: 44px; padding: 13px 0 10px; font-size: 10px; font-weight: 700; }
.measurement-details p { margin: 0 0 12px; max-width: 360px; }
.measurement-details[open] { padding-bottom: 12px; }
.summary-title { font-size: clamp(50px, 15vw, 76px); line-height: .98; margin: 0 0 24px; }
.summary-facts { width: 100%; max-width: 360px; }
.summary-fact { display: flex; align-items: baseline; gap: 12px; margin: 0; padding: 11px 0; border-top: 1px solid #1f19334d; font-size: 12px; font-weight: 800; }
.summary-fact strong { font-family: Bungee, 'Arial Black', sans-serif; font-size: 23px; font-weight: 400; letter-spacing: -.04em; white-space: nowrap; }
.summary-fact span { overflow-wrap: anywhere; }
.summary-actions { display: flex; gap: 8px; flex-shrink: 0; }
.summary-actions .primary-action { flex: 1; }
.share-fallback { padding: 10px 0; font-size: 11px; }
.share-fallback input { width: 100%; min-height: 44px; border: 1px solid currentColor; background: var(--cream); color: var(--ink); padding: 8px; font-size: 11px; }
.story-controls { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 7px; flex-shrink: 0; min-height: 58px; padding-top: 8px; }
#next { grid-column: 3; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid color-mix(in srgb, currentColor 40%, transparent); border-radius: 50%; color: inherit; background: transparent; line-height: 1; }
.icon-button svg { display: block; width: 20px; height: 20px; }
.icon-button:hover:not(:disabled) { color: var(--scene); background: var(--text); }
/* Monthly columns turn the year's activity into a single Wrapped poster. */
.scene-comparison { padding-top: 12px; }
.scene-comparison .scene-body { justify-content: center; padding: 0; }
.comparison-panel { width: 100%; }
.chart-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 5px 0 0; }
.chart-title { font-size: clamp(30px, 8.7vw, 42px); line-height: 1.02; margin: 0; }
.chart-year { flex-shrink: 0; padding: 7px 6px; color: var(--cream); background: var(--purple); font-family: Bungee, 'Arial Black', sans-serif; font-size: clamp(21px, 6vw, 28px); font-weight: 400; line-height: 1; letter-spacing: -.07em; transform: rotate(8deg); }
.chart-caption { margin: 18px 0 13px; font-size: 11px; font-weight: 800; line-height: 1.5; }
.chart-plot { padding: 10px 7px 0; background: var(--cream); border-bottom: 4px solid var(--purple); }
.time-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: #1f19332b; stroke-width: 1; stroke-dasharray: 3 5; }
.chart-baseline { stroke: #1f1933; stroke-width: 1.5; }
.chart-tick, .chart-unit { fill: var(--ink); font-family: Manrope, Arial, sans-serif; font-size: 13px; font-weight: 700; }
.chart-unit { font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.chart-month { font-size: 12px; font-weight: 800; }
.chart-bar { transform-box: fill-box; transform-origin: center bottom; animation: bar-reveal .65s cubic-bezier(.2,.75,.25,1) var(--bar-delay, 0ms) both; }
.chart-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 15px 0 11px; }
.legend-row { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 2px 6px; align-items: center; min-width: 0; font-size: 11px; line-height: 1.25; }
.legend-row.is-selected .legend-name { font-weight: 800; }
.legend-swatch { width: 8px; height: 12px; border-radius: 2px 2px 0 0; }
.legend-name { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.legend-total { grid-column: 2; font-size: 9px; font-weight: 600; opacity: .75; }
.chart-note { margin: 0 0 8px; font-size: 9px; font-weight: 600; }
.chart-empty { margin: 0 0 8px; max-width: 325px; font-size: 11px; font-weight: 700; line-height: 1.4; }
.all-empty { font-size: 10px; font-weight: 500; }
.chart-details { border-top: 1px solid #1f193333; }
.chart-details summary { font-size: 10px; }
.chart-data { max-height: 340px; overflow: auto; padding: 0 2px 12px; font-size: 10px; line-height: 1.6; }
.chart-data p { margin: 0 0 12px; }
.chart-data table { width: 100%; border-collapse: collapse; font-size: 9px; }
.chart-data caption { text-align: left; font-size: 10px; font-weight: 800; padding-bottom: 10px; }
.chart-data th, .chart-data td { border-bottom: 1px solid #1f193326; padding: 7px 4px; text-align: left; vertical-align: top; }
@keyframes bar-reveal { from { transform: scaleY(0); } to { transform: scaleY(1); } }
/* Loading, recovery, and player selection use the same restrained type system. */
.state-screen { width: 100%; display: flex; flex-direction: column; justify-content: center; overflow-x: hidden; overflow-y: auto; padding: 22px 0; scrollbar-width: thin; }
.state-title { font-size: clamp(59px, 18vw, 90px); line-height: .98; margin: 0 0 22px; }
.state-copy { font-size: 14px; font-weight: 600; line-height: 1.6; max-width: 340px; margin: 0 0 20px; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; font-weight: 800; }
.chooser { position: relative; justify-content: flex-start; padding-top: 30px; }
.chooser .state-title { font-size: clamp(80px, 24vw, 112px); transform: rotate(-5deg); margin-bottom: 28px; }
.chooser-hat { position: absolute; top: 102px; right: 0; width: 110px; height: 110px; object-fit: contain; image-rendering: pixelated; transform: rotate(15deg); }
.search-label { display: flex; flex-direction: column; gap: 9px; font-size: 10px; font-weight: 800; }
.search-input { width: 100%; min-height: 48px; border: 2px solid var(--ink); padding: 12px; border-radius: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-input::placeholder { color: var(--ink); opacity: .6; }
.player-list { margin-top: 15px; }
.player-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 53px; padding: 12px 0; border-bottom: 1px solid #1f19334d; font-size: 20px; font-weight: 800; letter-spacing: -.04em; text-decoration: none; overflow-wrap: anywhere; }
.player-choice:hover { color: var(--purple); }
.choice-arrow { flex-shrink: 0; font-size: 24px; }
@keyframes scene-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 600px) {
  body { display: flex; align-items: center; justify-content: center; min-height: 100dvh; background: repeating-linear-gradient(-45deg, #1f1933 0, #1f1933 48px, #27213d 48px, #27213d 49px); }
  .experience { width: 480px; height: min(100dvh, 960px); box-shadow: 0 0 90px #0004; }
}
@media (max-height: 740px) {
  .experience { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .scene { padding-top: 8px; }
  .scene-body { padding-top: 8px; padding-bottom: 22px; }
  .story-skill { width: 52px; height: 52px; margin-bottom: 22px; }
  .wrapped-title { font-size: clamp(80px, 23vw, 106px); margin-bottom: 20px; }
  .personal-line { font-size: 19px; margin-top: 20px; }
  .fact-value { font-size: clamp(72px, 21vw, 100px); }
  .fact-label { font-size: clamp(22px, 6.3vw, 30px); margin-top: 12px; }
  .summary-title { font-size: 60px; margin-bottom: 18px; }
  .summary-fact { padding: 9px 0; }
  .chart-caption { margin-top: 13px; }
}
@media (max-width: 350px) {
  .experience { padding-left: 18px; padding-right: 18px; }
  .chart-heading { gap: 7px; }
  .chart-title { font-size: 29px; }
  .chart-year { font-size: 21px; }
  .chart-caption { font-size: 10px; }
  .summary-actions { gap: 6px; }
  .primary-action, .secondary-action { padding: 11px 10px; font-size: 11px; }
  .summary-fact { font-size: 11px; }
  .summary-fact strong { font-size: 21px; }
}
@media (max-height: 590px) {
  .progress-track { height: 14px; }
  .story-controls { min-height: 51px; padding-top: 4px; }
  .scene-body { padding-bottom: 15px; }
  .player-name { font-size: 19px; margin-bottom: 12px; }
  .edition-label { margin-bottom: 12px; font-size: 10px; }
  .wrapped-title { font-size: 79px; margin-bottom: 13px; }
  .personal-line { font-size: 16px; margin-top: 16px; }
  .story-skill { width: 42px; height: 42px; margin-bottom: 16px; }
  .fact-value { font-size: 75px; }
  .fact-label { font-size: 23px; margin-top: 9px; }
  .summary-title { font-size: 47px; margin-bottom: 16px; }
  .summary-fact { padding: 7px 0; }
  .summary-fact strong { font-size: 21px; }
  .sparse-copy { font-size: 11px; line-height: 1.5; }
  .scene-comparison { padding-top: 4px; }
  .chart-caption { margin: 10px 0; }
  .chart-empty { margin-bottom: 6px; }
  .chart-legend { margin: 10px 0 8px; gap: 7px 10px; }
  .chart-note { margin-bottom: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
