:root {
  color-scheme: light;
  --pink: #ffd2e8;
  --pink-strong: #ff9ecb;
  --purple: #7b2cbf;
  --purple-soft: #c77dff;
  --ink: #311a32;
  --muted: #70536d;
  --white: #fff9fd;
  --shadow: 0 18px 45px rgba(80, 24, 90, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-rounded, "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  color: var(--ink);
  background: var(--pink);
}

button,
a {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  overflow: hidden;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: clamp(20px, 4vw, 48px);
  position: relative;
}

.screen.is-active {
  display: flex;
}

.title-screen {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.55), transparent 25%),
    linear-gradient(135deg, #ffd6ec 0%, #ffb6dc 56%, #ffcce9 100%);
}

.heart-field,
.heart-field::before,
.heart-field::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 35% 35%, var(--purple) 0 9px, transparent 10px),
    radial-gradient(circle at 65% 35%, var(--purple) 0 9px, transparent 10px),
    conic-gradient(from 45deg at 50% 62%, transparent 0 25%, var(--purple) 0 50%, transparent 0);
  background-size: 120px 120px;
  background-position: 12px 18px;
  opacity: 0.22;
}

.heart-field::before,
.heart-field::after {
  content: "";
}

.heart-field::before {
  background-size: 170px 170px;
  background-position: 72px 42px;
  opacity: 0.16;
}

.heart-field::after {
  background-size: 220px 220px;
  background-position: 28px 96px;
  opacity: 0.12;
}

.title-content {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  text-align: center;
  padding: clamp(24px, 5vw, 56px);
}

.kicker {
  margin: 0 0 8px;
  color: var(--purple);
  font-size: clamp(0.88rem, 2vw, 1rem);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.03;
}

h1 {
  font-size: clamp(3rem, 12vw, 7.5rem);
}

h2 {
  font-size: clamp(2rem, 5vw, 4.25rem);
}

.intro {
  max-width: 540px;
  margin: 18px auto 28px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  line-height: 1.45;
}

.primary-button,
.secondary-button,
.text-button,
.reset-button,
.fruit-card {
  border: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.reset-button {
  min-height: 54px;
  border-radius: 8px;
  padding: 0 26px;
  font-weight: 900;
  box-shadow: var(--shadow);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.primary-button {
  color: white;
  background: var(--purple);
}

.secondary-button {
  color: var(--purple);
  background: var(--white);
}

.reset-button {
  color: white;
  background: #a3164f;
  align-self: flex-start;
}

.primary-button:hover,
.secondary-button:hover,
.reset-button:hover,
.fruit-card:hover {
  transform: translateY(-2px);
}

.picker-screen,
.chart-screen {
  flex-direction: column;
  gap: 28px;
  background:
    linear-gradient(rgba(255, 218, 237, 0.72), rgba(255, 218, 237, 0.72)),
    repeating-linear-gradient(45deg, transparent 0 36px, rgba(123, 44, 191, 0.08) 36px 38px);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.chart-link,
.sister-link,
.text-button {
  flex: 0 0 auto;
  min-height: 44px;
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--purple);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(80, 24, 90, 0.12);
}

.title-actions,
.top-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.top-links {
  justify-content: flex-end;
}

.sister-link {
  display: inline-flex;
  align-items: center;
}

.text-button {
  border: 0;
}

.fruit-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 32px);
  width: min(960px, 100%);
  margin: auto;
}

.fruit-card {
  display: grid;
  min-height: clamp(250px, 42vw, 420px);
  padding: clamp(18px, 3vw, 34px);
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 249, 253, 0.9);
  box-shadow: var(--shadow);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.fruit-card:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-button:focus-visible,
.reset-button:focus-visible,
.chart-link:focus-visible,
.sister-link:focus-visible {
  outline: 4px solid rgba(123, 44, 191, 0.35);
  outline-offset: 4px;
}

.fruit-art {
  position: relative;
  width: min(220px, 42vw);
  aspect-ratio: 1;
  margin-bottom: 18px;
}

.fruit-name {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-weight: 900;
}

.choice-actions {
  display: flex;
  justify-content: center;
  width: min(960px, 100%);
  margin: 0 auto;
}

.chart-body {
  display: grid;
  gap: 14px;
  width: min(900px, 100%);
  margin: 24px auto 0;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr minmax(48px, auto);
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 249, 253, 0.88);
  box-shadow: 0 8px 20px rgba(80, 24, 90, 0.1);
}

.bar-track {
  min-width: 0;
  height: 20px;
  border-radius: 999px;
  background: rgba(123, 44, 191, 0.14);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--pink-strong));
}

.empty-chart {
  width: min(620px, 100%);
  margin: 30px auto 0;
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 249, 253, 0.88);
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.45;
}

.fruit-picture,
.fruit-art {
  filter: drop-shadow(0 18px 22px rgba(80, 24, 90, 0.18));
}

.hero-watermelon {
  width: min(290px, 66vw);
  aspect-ratio: 1.32;
  margin: 0 auto 18px;
  position: relative;
}

.watermelon-rind,
.watermelon-flesh,
.seed,
.fruit-art span {
  position: absolute;
  display: block;
}

.watermelon-rind {
  inset: 0;
  border-radius: 0 0 180px 180px;
  background: #15803d;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.watermelon-flesh {
  inset: 7% 8% 14%;
  border-radius: 0 0 150px 150px;
  background: #ff4d6d;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.seed {
  width: 9%;
  height: 16%;
  border-radius: 50% 50% 50% 0;
  background: #26131f;
  transform: rotate(-45deg);
}

.seed-one {
  left: 35%;
  top: 31%;
}

.seed-two {
  left: 55%;
  top: 31%;
}

.seed-three {
  left: 46%;
  top: 52%;
}

.seed-four {
  left: 63%;
  top: 48%;
}

.fruit-art.watermelon .rind {
  inset: 0;
  border-radius: 50%;
  background: repeating-linear-gradient(90deg, #0f8b3a 0 18px, #1db954 18px 36px);
}

.fruit-art.watermelon .shine {
  inset: 13% 18% auto auto;
  width: 24%;
  height: 14%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  transform: rotate(-25deg);
}

.fruit-art.orange .body {
  inset: 6%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.42), transparent 15%),
    #ff8c1a;
}

.fruit-art.orange .leaf,
.fruit-art.apple .leaf {
  width: 24%;
  height: 13%;
  top: 2%;
  left: 50%;
  border-radius: 90% 0;
  background: #2f9e44;
  transform: rotate(-24deg);
}

.fruit-art.banana .body {
  inset: 18% 4% 18% 5%;
  border: 34px solid #ffd43b;
  border-left-color: transparent;
  border-top-color: transparent;
  border-radius: 50%;
  transform: rotate(-22deg);
}

.fruit-art.apple .body {
  inset: 9% 8% 4%;
  border-radius: 48% 48% 54% 54%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.38), transparent 14%),
    #e63946;
}

.fruit-art.grape .grape {
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #7b2cbf;
}

.fruit-art.grape .g1 {
  left: 35%;
  top: 8%;
}

.fruit-art.grape .g2 {
  left: 22%;
  top: 33%;
}

.fruit-art.grape .g3 {
  left: 49%;
  top: 33%;
}

.fruit-art.grape .g4 {
  left: 35%;
  top: 58%;
}

.fruit-art.strawberry .body {
  inset: 8% 17% 5%;
  border-radius: 58% 58% 62% 62%;
  background: #f03e3e;
  clip-path: polygon(50% 100%, 95% 30%, 72% 4%, 50% 14%, 28% 4%, 5% 30%);
}

.fruit-art.strawberry .leaf {
  inset: 0 auto auto 30%;
  width: 40%;
  height: 24%;
  background: #2f9e44;
  clip-path: polygon(50% 0, 62% 45%, 100% 25%, 72% 64%, 86% 100%, 50% 72%, 14% 100%, 28% 64%, 0 25%, 38% 45%);
}

.fruit-art.pear .body {
  inset: 5% 18% 4%;
  border-radius: 50% 50% 54% 54%;
  background: #a9e34b;
  clip-path: ellipse(38% 47% at 50% 59%);
}

.fruit-art.peach .body {
  inset: 7%;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 47%, rgba(180, 62, 82, 0.24) 48% 52%, transparent 53%),
    #ffb07c;
}

.fruit-art.pineapple .body {
  inset: 20% 16% 2%;
  border-radius: 46%;
  background:
    repeating-linear-gradient(45deg, rgba(122, 75, 0, 0.22) 0 3px, transparent 3px 22px),
    repeating-linear-gradient(-45deg, rgba(122, 75, 0, 0.22) 0 3px, transparent 3px 22px),
    #f2c94c;
}

.fruit-art.pineapple .leaf {
  inset: 0 22% auto;
  height: 32%;
  background: #2f9e44;
  clip-path: polygon(50% 0, 60% 48%, 90% 12%, 72% 60%, 100% 42%, 68% 78%, 50% 100%, 32% 78%, 0 42%, 28% 60%, 10% 12%, 40% 48%);
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
  }

  .top-links {
    justify-content: flex-start;
  }

  .fruit-pair {
    grid-template-columns: 1fr;
  }

  .fruit-card {
    min-height: 230px;
  }

  .chart-row {
    grid-template-columns: 1fr auto;
  }

  .bar-track {
    grid-column: 1 / -1;
    order: 3;
  }
}
