:root {
  color-scheme: light;
  --pink: #ffd1dc;
  --red: #b3262f;
  --brown: #6f4e37;
  --green: #6a994e;
  --cream: #fff8ea;
  --ink: #3a241c;
  --muted: #76594c;
  --shadow: 0 18px 42px rgba(84, 43, 24, 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(--cream);
}

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:
    linear-gradient(rgba(255, 248, 234, 0.68), rgba(255, 248, 234, 0.68)),
    repeating-linear-gradient(90deg, var(--pink) 0 48px, #fff2f6 48px 96px);
}

.parlor-stripes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(179, 38, 47, 0.12), transparent 28%),
    radial-gradient(circle at 15% 88%, rgba(106, 153, 78, 0.2), transparent 24%),
    radial-gradient(circle at 85% 18%, rgba(111, 78, 55, 0.16), transparent 22%);
}

.title-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(240px, 390px) minmax(280px, 620px);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  width: min(1100px, 100%);
}

.title-copy {
  text-align: left;
}

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

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

h1 {
  max-width: 720px;
  color: var(--brown);
  font-size: clamp(3rem, 10vw, 7.2rem);
}

h2 {
  color: var(--brown);
  font-size: clamp(2rem, 5vw, 4.2rem);
}

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

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

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

.primary-button,
.secondary-button,
.text-button,
.reset-button,
.choice-card,
.topping-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: var(--cream);
  background: var(--red);
}

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

.reset-button {
  color: white;
  background: var(--brown);
  align-self: flex-start;
}

.parlor-link,
.text-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--brown);
  background: rgba(255, 255, 255, 0.78);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(84, 43, 24, 0.12);
}

.text-button {
  border: 0;
}

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

.choice-screen,
.topping-screen,
.chart-screen {
  flex-direction: column;
  gap: 28px;
  background:
    linear-gradient(rgba(255, 248, 234, 0.82), rgba(255, 248, 234, 0.82)),
    repeating-linear-gradient(0deg, rgba(255, 209, 220, 0.9) 0 18px, transparent 18px 36px);
}

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

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

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

.choice-card,
.topping-card {
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.choice-card {
  min-height: clamp(250px, 42vw, 420px);
  padding: clamp(18px, 3vw, 34px);
}

.topping-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.5vw, 24px);
  width: min(980px, 100%);
  margin: auto;
}

.topping-card {
  min-height: 158px;
  padding: 18px;
}

.topping-card.is-selected {
  outline: 5px solid rgba(106, 153, 78, 0.42);
  background: #f5ffe9;
}

.choice-name {
  text-align: center;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 900;
}

.art {
  position: relative;
  width: min(220px, 42vw);
  aspect-ratio: 1;
  margin-bottom: 18px;
  filter: drop-shadow(0 18px 22px rgba(84, 43, 24, 0.18));
}

.topping-card .art {
  width: min(106px, 25vw);
  margin-bottom: 10px;
}

.art span,
.server span,
.sundae span {
  position: absolute;
  display: block;
}

.flavor .cone {
  inset: 46% 27% 0;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  background:
    repeating-linear-gradient(45deg, rgba(111, 78, 55, 0.22) 0 4px, transparent 4px 16px),
    #d99b53;
}

.flavor .scoop,
.cone-choice .scoop {
  inset: 6% 16% 35%;
  border-radius: 50% 50% 46% 46%;
}

.vanilla .scoop {
  background: #fff4c2;
}

.chocolate .scoop {
  background: #6f4e37;
}

.strawberry .scoop {
  background: #ff9db2;
}

.mint .scoop {
  background: #98d8aa;
}

.coffee .scoop {
  background: #b5835a;
}

.cookies .scoop {
  background:
    radial-gradient(circle at 35% 35%, #3a241c 0 7px, transparent 8px),
    radial-gradient(circle at 64% 55%, #3a241c 0 6px, transparent 7px),
    #efe3ca;
}

.cone-choice .scoop {
  background: #ff9db2;
}

.cone-choice .cone {
  inset: 42% 25% 0;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.cake-cone .cone {
  background: #e6bd7b;
}

.waffle-cone .cone {
  background:
    repeating-linear-gradient(45deg, rgba(111, 78, 55, 0.24) 0 4px, transparent 4px 16px),
    repeating-linear-gradient(-45deg, rgba(111, 78, 55, 0.2) 0 4px, transparent 4px 16px),
    #d99b53;
}

.sugar-cone .cone {
  background: #f4cf8a;
}

.cup .cone {
  inset: 54% 20% 10%;
  border-radius: 0 0 24px 24px;
  background: var(--green);
}

.topping .base {
  inset: 12%;
  border-radius: 50%;
  background: #fff4c2;
}

.sprinkles .bits {
  inset: 15%;
  background:
    linear-gradient(30deg, transparent 0 44%, var(--red) 44% 58%, transparent 58%) 20% 28% / 32px 24px,
    linear-gradient(-20deg, transparent 0 44%, var(--green) 44% 58%, transparent 58%) 70% 40% / 32px 24px,
    linear-gradient(80deg, transparent 0 44%, #4dabf7 44% 58%, transparent 58%) 45% 70% / 32px 24px;
}

.hot-fudge .drip {
  inset: 22% 18% 42%;
  border-radius: 46% 46% 30% 30%;
  background: #4d2d1f;
}

.cherry .stem {
  left: 50%;
  top: 8%;
  width: 4px;
  height: 38%;
  border-radius: 999px;
  background: var(--green);
  transform: rotate(24deg);
}

.cherry .fruit {
  inset: 42% 28% 15%;
  border-radius: 50%;
  background: var(--red);
}

.whipped-cream .cream {
  inset: 12% 14% 18%;
  border-radius: 50% 50% 42% 42%;
  background:
    radial-gradient(circle at 50% 18%, white 0 18%, transparent 19%),
    radial-gradient(circle at 35% 44%, white 0 24%, transparent 25%),
    radial-gradient(circle at 65% 46%, white 0 24%, transparent 25%),
    radial-gradient(circle at 50% 68%, white 0 30%, transparent 31%);
}

.nuts .bits {
  inset: 18%;
  background:
    radial-gradient(circle at 30% 32%, #b08968 0 8px, transparent 9px),
    radial-gradient(circle at 62% 28%, #a47148 0 7px, transparent 8px),
    radial-gradient(circle at 48% 62%, #b08968 0 9px, transparent 10px),
    radial-gradient(circle at 72% 68%, #a47148 0 7px, transparent 8px);
}

.caramel .drip {
  inset: 22% 18% 42%;
  border-radius: 46% 46% 30% 30%;
  background: #c77d2d;
}

.server-scene {
  position: relative;
  min-height: 500px;
}

.server {
  position: absolute;
  left: 10%;
  bottom: 0;
  width: 220px;
  height: 430px;
  filter: drop-shadow(0 20px 24px rgba(84, 43, 24, 0.18));
}

.server .hat {
  left: 38px;
  top: 0;
  width: 138px;
  height: 48px;
  background: white;
  clip-path: polygon(0 100%, 8% 18%, 50% 0, 92% 18%, 100% 100%);
  border-bottom: 8px solid var(--red);
}

.server .face {
  left: 57px;
  top: 52px;
  width: 104px;
  height: 114px;
  border-radius: 44% 44% 50% 50%;
  background: #f4c7a1;
}

.server .hair {
  left: 52px;
  top: 45px;
  width: 114px;
  height: 44px;
  border-radius: 50% 50% 20% 20%;
  background: #4a2f24;
}

.server .shirt {
  left: 34px;
  top: 160px;
  width: 152px;
  height: 150px;
  border-radius: 20px 20px 4px 4px;
  background: #f7f2e8;
}

.server .apron {
  left: 55px;
  top: 178px;
  width: 110px;
  height: 172px;
  border-radius: 8px;
  background: white;
  border-top: 12px solid var(--green);
}

.server .bowtie {
  left: 88px;
  top: 154px;
  width: 42px;
  height: 22px;
  background: var(--red);
  clip-path: polygon(0 0, 50% 50%, 0 100%, 100% 100%, 50% 50%, 100% 0);
}

.server .arm {
  top: 188px;
  width: 54px;
  height: 142px;
  border-radius: 999px;
  background: #f7f2e8;
}

.server .arm-left {
  left: 0;
  transform: rotate(18deg);
}

.server .arm-right {
  right: -10px;
  transform: rotate(-28deg);
}

.server .slacks {
  left: 45px;
  top: 325px;
  width: 132px;
  height: 105px;
  border-radius: 4px 4px 16px 16px;
  background: var(--brown);
}

.sundae {
  position: absolute;
  right: 4%;
  bottom: 50px;
  width: 190px;
  height: 260px;
  filter: drop-shadow(0 18px 18px rgba(84, 43, 24, 0.18));
}

.sundae .dish {
  inset: 58% 14% 8%;
  border-radius: 0 0 44px 44px;
  background: rgba(255, 255, 255, 0.82);
  border: 6px solid rgba(111, 78, 55, 0.26);
}

.sundae .scoop {
  width: 74px;
  height: 74px;
  border-radius: 50%;
}

.sundae .vanilla {
  left: 56px;
  top: 55px;
  background: #fff4c2;
}

.sundae .strawberry {
  left: 22px;
  top: 102px;
  background: #ff9db2;
}

.sundae .mint {
  left: 93px;
  top: 102px;
  background: #98d8aa;
}

.sundae .cherry {
  left: 84px;
  top: 36px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
}

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

.chart-group {
  display: grid;
  gap: 12px;
}

.chart-group h3 {
  margin: 0;
  color: var(--brown);
  font-size: 1.5rem;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(130px, 210px) 1fr minmax(48px, auto);
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(84, 43, 24, 0.1);
}

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

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

.empty-chart {
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.45;
}

.choice-card:focus-visible,
.topping-card:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-button:focus-visible,
.reset-button:focus-visible,
.parlor-link:focus-visible {
  outline: 4px solid rgba(179, 38, 47, 0.34);
  outline-offset: 4px;
}

@media (max-width: 800px) {
  .title-layout,
  .choice-pair,
  .topping-grid {
    grid-template-columns: 1fr;
  }

  .title-copy {
    text-align: center;
  }

  .intro {
    margin-right: auto;
    margin-left: auto;
  }

  .title-actions,
  .top-links {
    justify-content: center;
  }

  .server-scene {
    min-height: 430px;
  }

  .server {
    left: 4%;
    transform: scale(0.86);
    transform-origin: bottom left;
  }

  .sundae {
    right: 0;
    transform: scale(0.82);
    transform-origin: bottom right;
  }

  .topbar {
    flex-direction: column;
  }

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

@media (max-width: 560px) {
  .chart-row {
    grid-template-columns: 1fr auto;
  }

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