:root {
  color-scheme: light;
  --sky: #dff4ff;
  --brick: #a63d2f;
  --apple: #d62828;
  --green: #2f9e44;
  --grill: #2f3437;
  --steel: #d7dde0;
  --char: #191d1f;
  --cream: #fff8ed;
  --ink: #241a16;
  --muted: #6e5a51;
  --shadow: 0 18px 42px rgba(36, 26, 22, 0.2);
}

* { box-sizing: border-box; }

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

button, a, input { font: inherit; }

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

.heart-tag,
.creator-tag,
.visitor-counter {
  position: fixed;
  z-index: 5;
  margin: 0;
  padding: 9px 14px;
  border-radius: 8px;
  background: rgba(255, 248, 237, 0.92);
  box-shadow: 0 10px 24px rgba(36, 26, 22, 0.14);
  font-weight: 900;
}

.heart-tag { top: 14px; left: 50%; font-size: clamp(1rem, 4vw, 1.55rem); transform: translateX(-50%); }
.creator-tag { right: 18px; bottom: 18px; color: var(--apple); }
.visitor-counter { left: 18px; bottom: 18px; }

.screen {
  display: none;
  min-height: 100vh;
  padding: clamp(22px, 4vw, 48px);
  padding-bottom: 130px;
  background:
    linear-gradient(rgba(223, 244, 255, 0.86), rgba(255, 248, 237, 0.92)),
    repeating-linear-gradient(0deg, rgba(166, 61, 47, 0.13) 0 24px, transparent 24px 48px);
}

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

.start-screen,
.builder-screen,
.chart-screen {
  position: relative;
  flex-direction: column;
  gap: 24px;
}

.skyline {
  position: absolute;
  inset: auto 0 0;
  height: 220px;
  pointer-events: none;
}

.skyline span { position: absolute; display: block; bottom: 0; }
.building-one { left: 8%; width: 90px; height: 150px; background: #5d6d7e; }
.building-two { left: 22%; width: 120px; height: 190px; background: #34495e; }
.building-three { right: 12%; width: 100px; height: 168px; background: #607d8b; }
.apple { left: 50%; width: 54px; height: 54px; border-radius: 50%; background: var(--apple); transform: translateX(-50%); }
.apple::before { content: ""; position: absolute; left: 28px; top: -12px; width: 22px; height: 12px; border-radius: 90% 0; background: var(--green); }

.title-card,
.choice-panel,
.grill-preview,
.served-card,
.chart-group {
  border-radius: 8px;
  background: rgba(255, 248, 237, 0.93);
  box-shadow: var(--shadow);
}

.title-card {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  margin: 46px auto 0;
  padding: clamp(24px, 5vw, 46px);
  text-align: center;
}

.kicker { margin: 0 0 8px; color: var(--apple); font-weight: 900; text-transform: uppercase; }
h1, h2, h3 { margin: 0; }
h1 { color: var(--apple); font-size: clamp(3.4rem, 13vw, 8rem); line-height: 0.95; }
h2 { color: var(--apple); font-size: clamp(2rem, 5vw, 4rem); line-height: 1.05; }
h3 { color: var(--green); font-size: 1.15rem; }

.intro,
.summary-text,
.step-copy,
.empty-chart,
.chart-note {
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  font-weight: 800;
  line-height: 1.45;
}

.site-links,
.button-row,
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.site-links { justify-content: center; }
.topbar { justify-content: space-between; width: min(1120px, 100%); margin: 34px auto 0; }

.site-links a,
.play-button,
.primary-button,
.secondary-button,
.text-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.site-links a,
.text-button { color: var(--apple); background: white; }
.play-button, .primary-button { color: white; background: var(--apple); }
.secondary-button { color: white; background: var(--green); }
button:disabled { cursor: not-allowed; opacity: 0.5; box-shadow: none; }

.play-button { min-width: 150px; margin-top: 12px; font-size: 1.25rem; }

.builder-layout {
  display: grid;
  grid-template-columns: minmax(310px, 1fr) minmax(320px, 430px);
  gap: 24px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.choice-panel,
.grill-preview {
  padding: clamp(18px, 3vw, 26px);
}

.step-panel { display: none; }
.step-panel.is-active { display: grid; gap: 16px; }

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dense-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.option-grid label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(47, 158, 68, 0.1);
  font-weight: 850;
}

.button-row { justify-content: space-between; margin-top: 18px; }

.grill-preview { display: grid; place-items: center; text-align: center; }

.grill-scene {
  position: relative;
  width: min(360px, 76vw);
  height: 320px;
  margin: 0 auto 12px;
}

.grill,
.plate-preview,
.served-plate { position: absolute; }
.grill { left: 50%; top: 34px; width: 250px; height: 210px; transform: translateX(-50%); }
.grill span, .plate-preview span, .served-plate span { position: absolute; display: block; }
.lid { left: 30px; top: 0; width: 190px; height: 92px; border-radius: 92px 92px 16px 16px; background: var(--grill); }
.grate { left: 24px; top: 86px; width: 202px; height: 22px; border-radius: 999px; background: repeating-linear-gradient(90deg, var(--steel) 0 10px, var(--char) 10px 16px); }
.grill::after { content: ""; position: absolute; left: 44px; top: 108px; width: 160px; height: 86px; border-radius: 0 0 24px 24px; background: var(--grill); }
.flame { z-index: 1; top: 116px; width: 24px; height: 42px; border-radius: 50% 50% 50% 0; background: #ffb703; opacity: 0; transform: rotate(-45deg); animation: flame 480ms ease-in-out infinite alternate; }
.flame-one { left: 84px; }
.flame-two { left: 132px; animation-delay: 160ms; }
.is-lit .flame { opacity: 1; }
.food { z-index: 2; top: 68px; width: 44px; height: 26px; border-radius: 50%; background: #7f4f24; opacity: 0; }
.has-food .food { opacity: 1; }
.food-one { left: 58px; }
.food-two { left: 104px; background: #ffd166; }
.food-three { left: 150px; background: #e76f51; }
.is-flipped .food { animation: flipFood 800ms ease; }

.plate-preview { right: 8px; bottom: 0; width: 126px; height: 90px; opacity: 0; }
.has-finish .plate-preview { opacity: 1; }
.plate-preview .plate { inset: 28px 4px 0; border-radius: 50%; background: white; border: 8px solid var(--apple); }
.plate-preview .served-food { left: 42px; top: 30px; width: 42px; height: 28px; border-radius: 50%; background: #7f4f24; }
.plate-preview .cutlery { right: 4px; top: 14px; width: 8px; height: 72px; border-radius: 999px; background: var(--steel); transform: rotate(18deg); }

.served-screen {
  align-items: center;
  justify-content: center;
}

.served-card {
  width: min(700px, 100%);
  padding: clamp(24px, 5vw, 44px);
  text-align: center;
}

.served-plate {
  position: relative;
  width: 260px;
  height: 190px;
  margin: 20px auto;
}

.served-plate .plate { inset: 44px 16px 8px; border-radius: 50%; background: white; border: 14px solid var(--green); }
.main-food { left: 82px; top: 74px; width: 88px; height: 56px; border-radius: 50%; background: #7f4f24; }
.side { width: 38px; height: 28px; border-radius: 12px; background: #ffd166; }
.side-one { left: 58px; top: 98px; }
.side-two { right: 58px; top: 100px; background: #2f9e44; }
.fork { right: 12px; top: 40px; width: 10px; height: 120px; border-radius: 999px; background: var(--steel); transform: rotate(18deg); }

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

.chart-group { display: grid; gap: 12px; padding: 18px; }
.chart-row { display: grid; grid-template-columns: minmax(150px, 240px) 1fr auto; align-items: center; gap: 12px; }
.bar-track { height: 18px; border-radius: 999px; background: rgba(47, 158, 68, 0.14); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--apple), var(--green)); }
.chart-empty-line { margin: 0; color: var(--muted); font-weight: 800; }

@keyframes flame { to { transform: rotate(-45deg) scale(1.12); } }
@keyframes flipFood {
  50% { transform: translateY(-34px) rotate(180deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

@media (max-width: 880px) {
  .builder-layout { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .dense-grid, .option-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .heart-tag { position: relative; top: auto; left: auto; display: table; margin: 12px auto 0; transform: none; }
  .creator-tag { right: 50%; transform: translateX(50%); }
  .visitor-counter { left: 50%; bottom: 64px; transform: translateX(-50%); }
  .screen { padding-bottom: 178px; }
  .chart-row { grid-template-columns: 1fr auto; }
  .bar-track { grid-column: 1 / -1; order: 3; }
}
