:root {
  --page-bg: #ffffff;
  --surface: #ffffff;
  --text: #111111;
  --muted: #777777;
  --border: #777777;
  --faint: #e5e5e5;
  --inactive-line: #dedede;
  --font-body: "DIN Pro", "DINPro", Arial, "Helvetica Neue", sans-serif;
  --chart-top: 295px;
  --chart-height: 270px;
  --scrub-hint-gap: 8px;
}

@font-face {
  font-family: "DIN Pro";
  src: url("../assets/fonts/DINPro-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DIN Pro";
  src: url("../assets/fonts/DINPro-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DIN Pro";
  src: url("../assets/fonts/DINPro-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DIN Pro";
  src: url("../assets/fonts/DINPro-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--page-bg);
}

body {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  overscroll-behavior: none;
}

html.custom-cursor-enabled,
html.custom-cursor-enabled * {
  cursor: none !important;
}

.custom-cursor {
  width: 44px;
  height: 44px;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  border: 1px solid rgba(50, 50, 50, 0.05);
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.05s ease-out, opacity 0.12s ease-out;
}

.custom-cursor.visible {
  opacity: 1;
}

.custom-cursor.clicking {
  transform: translate(-50%, -50%) scale(0.85);
}

.app-shell {
  width: 402px;
  height: 874px;
  max-width: 100%;
  max-height: calc(100vh - 4rem);
  max-height: calc(100dvh - 4rem);
  position: relative;
  overflow: hidden;
  border-radius: 54px;
  outline: 1px solid #ffffff;
  background: var(--surface);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.18);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.app-shell * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.blueprint-debug-overlay {
  position: absolute;
  inset: 0;
  z-index: 110;
  display: none;
  color: #006fd6;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.25;
  pointer-events: none;
}

.blueprint-line,
.blueprint-label {
  position: absolute;
}

.blueprint-line {
  display: block;
  background: currentColor;
}

.blueprint-line-v {
  top: 0;
  bottom: 0;
  width: 1px;
}

.blueprint-line-h {
  left: 0;
  right: 0;
  height: 1px;
}

.blueprint-line-left {
  left: 30px;
}

.blueprint-line-right {
  right: 30px;
}

.blueprint-line-top-100 {
  top: 100px;
}

.blueprint-line-top-150 {
  top: 150px;
}

.blueprint-line-bottom-74 {
  bottom: 74px;
}

.blueprint-line-bottom-54 {
  bottom: 54px;
}

.blueprint-label-top-left,
.blueprint-label-content-left,
.blueprint-label-bottom-74-left,
.blueprint-label-bottom-54-left {
  left: 40px;
}

.blueprint-label-top-right,
.blueprint-label-content-right,
.blueprint-label-bottom-74-right,
.blueprint-label-bottom-54-right {
  right: 40px;
}

.blueprint-label-top-left,
.blueprint-label-top-right {
  top: 108px;
}

.blueprint-label-content-left,
.blueprint-label-content-right {
  top: 158px;
}

.blueprint-label-gap-left,
.blueprint-label-gap-right {
  top: 125px;
}

.blueprint-label-gap-left,
.blueprint-label-side-left {
  left: 6px;
}

.blueprint-label-gap-right,
.blueprint-label-side-right {
  right: 6px;
}

.blueprint-label-side-left,
.blueprint-label-side-right {
  bottom: 112px;
}

.blueprint-label-bottom-74-left,
.blueprint-label-bottom-74-right {
  bottom: 78px;
}

.blueprint-label-bottom-54-left,
.blueprint-label-bottom-54-right {
  bottom: 58px;
}

.status-bar {
  width: 100%;
  height: 60px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  padding-top: 11px;
  pointer-events: none;
}

.dynamic-island {
  width: 126px;
  height: 37px;
  border-radius: 100px;
  background: #000000;
}

.stage {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(402px, 100%);
  display: none;
  background: var(--surface);
  transform: translateX(-50%);
}

.screen.active {
  display: block;
}

.choice-copy {
  position: absolute;
  left: 30px;
  top: 150px;
  width: 344px;
}

.choice-copy h1 {
  color: var(--text);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
}

.choice-copy p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
}

.character-grid {
  position: absolute;
  left: 50%;
  top: 249px;
  width: 342px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  transform: translateX(-50%);
}

.character-card {
  min-height: 168px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  font: inherit;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.character-card:hover,
.character-card:focus-visible {
  border-color: #000000;
  box-shadow: inset 0 0 0 1px #000000;
  outline: none;
  opacity: 0.75;
}

.character-card.is-selected {
  border: 2px solid #000000;
  outline: none;
}

.character-card:active {
  transform: scale(0.985);
}

.character-image-wrap {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.character-image {
  width: 68px;
  height: 68px;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.selection-copy {
  position: absolute;
  left: 30px;
  top: 459px;
  width: 342px;
  color: #111111;
  font-size: 18px;
  line-height: 1.27;
}

.selection-copy strong {
  font-weight: 700;
}

.continue-btn {
  width: 155px;
  min-height: 47px;
  position: absolute;
  right: 30px;
  bottom: 54px;
  border: 1px solid #000000;
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  transition: transform 0.12s ease;
}

.continue-btn:focus-visible,
.continue-btn:active,
.continue-btn.is-pressed {
  opacity: 0.75;
  filter: opacity(0.75);
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .continue-btn:hover,
  .continue-btn.is-hovered {
    opacity: 0.75;
    filter: opacity(0.75);
  }
}

.investment-heading {
  position: absolute;
  left: 30px;
  top: 150px;
}

.investment-heading h2,
.investment-heading p {
  color: #111111;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
}

.investment-heading p {
  margin-top: 4px;
}

.chart-wrap {
  width: 342px;
  height: var(--chart-height);
  position: absolute;
  left: 30px;
  top: var(--chart-top);
  touch-action: none;
}

.investment-chart {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.axis-line {
  stroke: var(--faint);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.growth-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.growth-line.comparison {
  stroke: #d9d9d9;
  stroke-width: 4;
}

.growth-line.active-growth {
  stroke: #222222;
  stroke-width: 4;
}

.year-labels text {
  fill: #9a9a9a;
  font: 500 12px var(--font-body);
}

.scrub-cursor {
  display: none;
}

.chart-screen.is-scrubbing .scrub-cursor {
  display: block;
}

.scrub-line {
  stroke: #d0d0d0;
  stroke-width: 1;
}

.scrub-year-label {
  fill: #9a9a9a;
  font: 500 12px var(--font-body);
}

.investment-scrub {
  display: none;
}

.chart-screen.is-scrubbing .investment-normal {
  display: none;
}

.chart-screen.is-scrubbing .investment-scrub {
  display: block;
}

.scrub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
  color: #111111;
}

.scrub-row + .scrub-row {
  margin-top: 4px;
}

.scrub-char-img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: cover;
  flex: 0 0 auto;
}

.scrub-row-comparison {
  color: var(--muted);
}

.scrub-you {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.chart-marker {
  width: 42px;
  height: 55px;
  position: absolute;
  display: block;
  transform: translate(-50%, -100%);
  transition: left 520ms cubic-bezier(0.32, 0, 0, 1), top 520ms cubic-bezier(0.32, 0, 0, 1), opacity 0.2s ease;
}

.chart-screen.no-marker-transition .chart-marker {
  transition: none;
}

.chart-screen.is-scrubbing .chart-marker {
  transition: none;
  opacity: 0 !important;
}

.chart-marker img {
  width: 32px;
  height: 32px;
  display: block;
  position: absolute;
  left: 50%;
  bottom: 0;
  object-fit: cover;
  transform: translateX(-50%);
}

.marker-label {
  position: absolute;
  left: 50%;
  bottom: 34px;
  padding: 2px;
  border-radius: 2px;
  background: #ffffff;
  color: #777777;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  transform: translateX(-50%);
  white-space: nowrap;
}

.scrub-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--chart-top) + var(--chart-height) + var(--scrub-hint-gap));
  padding: 0 30px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  transition: opacity 0.5s ease;
}

.scrub-hint.is-dismissed {
  opacity: 0;
  pointer-events: none;
}

/* Visualize button */
.visualize-btn {
  position: absolute;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
}

/* Table screen */
.table-header {
  position: absolute;
  left: 30px;
  right: 30px;
  top: 150px;
  display: flex;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--faint);
  font-weight: 500;
}

.th-spacer {
  flex: 0 0 44px;
}

.th-char {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.table-char-img {
  width: 22px;
  height: 22px;
  object-fit: cover;
}

.table-you {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.table-rows {
  position: absolute;
  left: 30px;
  right: 30px;
  top: 200px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-weight: 500;
}

.table-row {
  display: flex;
  align-items: center;
  margin: 0 -8px;
  padding: 0 8px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(8px);
}

.t-year {
  flex: 0 0 44px;
  font-size: 12px;
  color: var(--muted);
}

.t-val {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
}

.t-val.zero-val {
  color: var(--muted);
}

.t-val.comp-val {
  color: #afafaf;
}

.t-val.comp-val.cell-highlighted {
  color: var(--text);
}

.val-text {
  display: inline-block;
  position: relative;
  isolation: isolate;
  border-radius: 6px;
  transition: background 0.35s ease, padding 0.35s ease;
}

.val-text.is-elevated-pill::before {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: -1;
  border-radius: 8px;
  background: #f5f5f5;
}


.t-val.cell-highlighted .val-text {
  background: #f5f5f5;
  padding: 8px 16px;
  margin: -8px 0;
}

.table-narrative {
  position: absolute;
  left: 30px;
  right: 30px;
  top: 438px;
  font-size: 18px;
  line-height: 1.5;
  opacity: 0;
}

.table-narrative p + p {
  margin-top: 12px;
}

.table-action-btn {
  min-width: 140px;
  position: absolute;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: 0;
}

.table-action-btn.btn-visible {
  opacity: 1;
}

.chart-controls {
  position: absolute;
  left: 50%;
  bottom: 54px;
  width: 342px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transform: translateX(-50%);
}

.chart-controls.is-start {
  justify-content: flex-end;
}

.year-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  border: 1.5px solid #111111;
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  transition: transform 0.12s ease;
  white-space: nowrap;
}

.year-arrow {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 auto;
}

.year-arrow-back {
  transform: rotate(180deg);
}

.back-year-btn {
  padding-left: 8px;
}

.fast-forward-btn {
  padding-right: 8px;
}

.year-btn:focus-visible,
.year-btn:active,
.year-btn.is-pressed {
  opacity: 0.75;
  filter: opacity(0.75);
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .year-btn:hover,
  .year-btn.is-hovered {
    opacity: 0.75;
    filter: opacity(0.75);
  }
}

.year-btn:active {
  transform: scale(0.98);
}

.table-action-btn,
.table-action-btn:active,
.visualize-btn,
.visualize-btn:active {
  transition: opacity 0.4s ease;
  transform: translateX(-50%);
}

.year-btn[hidden],
[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 440px), (max-height: 956px) {
  :root {
    --chart-top: 245px;
  }

  html {
    overflow: hidden;
    height: 100%;
  }

  body {
    height: 100dvh;
    min-height: 100dvh;
    padding: 0;
    background: var(--page-bg);
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    outline: 0;
    box-shadow: none;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .status-bar {
    display: none;
  }

  .blueprint-line-top-150,
  .blueprint-label-content-left,
  .blueprint-label-content-right {
    display: none;
  }

  .choice-copy,
  .investment-heading,
  .table-header {
    top: 100px;
  }

  .character-grid {
    top: 199px;
  }

  .choice-copy,
  .character-grid,
  .selection-copy,
  .chart-wrap {
    width: calc(100% - 60px);
  }

  .chart-wrap {
    top: var(--chart-top);
  }

  .table-rows {
    top: 150px;
  }
}

@media (max-width: 380px) {
  .character-grid {
    gap: 10px;
  }

  .character-card {
    min-height: 154px;
    padding: 20px 10px;
    font-size: 15px;
  }
}
