:root {
  color-scheme: light;
  --ink: #1c1d24;
  --muted: #686a75;
  --paper: #fff8ef;
  --panel: #ffffff;
  --lime: #b9f45f;
  --tomato: #ff5f4f;
  --aqua: #42d9c8;
  --plum: #6b4cff;
  --gold: #ffc845;
  --line: rgba(28, 29, 36, 0.14);
  --shadow: 0 22px 70px rgba(31, 30, 42, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 200, 69, 0.46), transparent 28rem),
    linear-gradient(135deg, #fff8ef 0%, #f7ffdf 42%, #e7fbff 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.picker-band,
.history-band {
  position: relative;
  width: 100%;
}

.masthead,
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--tomato);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.35rem, 6vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.zip-chip {
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--lime);
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 900;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 22px;
  align-items: stretch;
}

.lunch-stage {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(145deg, #20212b 0%, #35373f 42%, #ffe66a 42%, #ffe66a 100%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
  box-shadow: var(--shadow);
}

.meal-card {
  position: absolute;
  left: clamp(18px, 5vw, 54px);
  right: clamp(18px, 8vw, 110px);
  bottom: clamp(20px, 5vw, 56px);
  z-index: 2;
  max-height: calc(100% - 40px);
  overflow-y: auto;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 34px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 9px 9px 0 var(--ink);
}

.meal-tag {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--aqua);
  color: var(--ink);
  font-weight: 900;
}

.meal-card h2 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 4.7rem);
  line-height: 0.94;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.restaurant {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: clamp(1rem, 2vw, 1.28rem);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contact-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffaf3;
}

.contact-card[hidden] {
  display: none;
}

.contact-card div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.contact-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.contact-card a {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 850;
  text-decoration-color: rgba(28, 29, 36, 0.35);
  text-underline-offset: 3px;
}

.meal-note {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.meal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meal-meta span {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.emoji-orbit {
  position: absolute;
  top: 34px;
  right: clamp(20px, 7vw, 84px);
  z-index: 1;
  display: grid;
  width: clamp(120px, 20vw, 210px);
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 12px 12px 0 rgba(28, 29, 36, 0.94);
  font-size: clamp(4rem, 11vw, 8rem);
  transform: rotate(-7deg);
  transition: transform 260ms ease, scale 260ms ease;
}

.emoji-orbit.spin {
  scale: 1.04;
  transform: rotate(9deg);
}

.burst {
  position: absolute;
  border: 2px solid var(--ink);
  transform: rotate(18deg);
}

.burst-one {
  top: 72px;
  left: 52px;
  width: 88px;
  height: 88px;
  background: var(--tomato);
}

.burst-two {
  right: 90px;
  bottom: 168px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--plum);
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--ink);
}

.button-row {
  display: grid;
  gap: 10px;
}

button {
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 950;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button:hover:not(:disabled) {
  transform: translate(-2px, -2px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.primary-action {
  background: var(--tomato);
  box-shadow: 5px 5px 0 var(--ink);
}

.secondary-action {
  background: var(--lime);
  box-shadow: 5px 5px 0 var(--ink);
}

.ghost-action {
  background: #f5f6f8;
}

.data-status {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 8px;
  background: #fffaf3;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.7rem;
  font-weight: 950;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.filters {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.filters label {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.history-band {
  margin-top: 34px;
}

.section-heading {
  align-items: center;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
}

.section-heading p {
  max-width: 320px;
  margin-bottom: 0;
  color: var(--muted);
  text-align: right;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.history-emoji {
  display: grid;
  width: 44px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  font-size: 1.45rem;
}

.history-copy strong {
  display: block;
  overflow-wrap: anywhere;
}

.history-copy span {
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.history-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.history-status {
  border-radius: 999px;
  padding: 7px 10px;
  background: #f0f2f5;
  font-size: 0.82rem;
  font-weight: 950;
}

.history-status.picked {
  background: var(--lime);
}

.empty-history {
  border: 1px dashed rgba(28, 29, 36, 0.35);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
}

.emoji-pop {
  pointer-events: none;
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 10;
  display: grid;
  width: min(42vw, 260px);
  aspect-ratio: 1;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: 12px 12px 0 var(--ink);
  font-size: min(24vw, 140px);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2) rotate(-18deg);
}

.emoji-pop.show {
  animation: lunch-pop 720ms cubic-bezier(0.16, 1, 0.3, 1);
}

.picked-pop {
  pointer-events: none;
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 11;
  display: grid;
  width: min(88vw, 430px);
  gap: 4px;
  justify-items: center;
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 24px 20px 22px;
  background: var(--lime);
  box-shadow: 12px 12px 0 var(--ink);
  opacity: 0;
  text-align: center;
  transform: translate(-50%, -50%) scale(0.72) rotate(-4deg);
}

.picked-pop.show {
  animation: picked-bounce 1400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.picked-pop span {
  font-size: clamp(3.6rem, 18vw, 7.5rem);
  line-height: 1;
}

.picked-pop strong {
  font-size: clamp(1.6rem, 6vw, 3rem);
  line-height: 1;
}

.picked-pop small {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

@keyframes lunch-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(-18deg);
  }
  28% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(5deg);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.62) rotate(12deg);
  }
}

@keyframes picked-bounce {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72) rotate(-4deg);
  }
  14% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05) rotate(2deg);
  }
  30%,
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(0.92) rotate(4deg);
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 22px, 620px);
    padding-top: 20px;
  }

  .masthead,
  .section-heading {
    display: grid;
    align-items: start;
  }

  .section-heading p {
    text-align: left;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .lunch-stage {
    min-height: 520px;
  }

  .meal-card {
    right: 18px;
  }

  .emoji-orbit {
    top: 26px;
    right: 22px;
  }
}

@media (max-width: 480px) {
  .contact-card div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .history-item {
    grid-template-columns: auto 1fr;
  }

  .history-status {
    grid-column: 2;
    width: fit-content;
  }
}
