:root {
  --cream: #f7f3ea;
  --paper: #fffdf8;
  --ink: #24372f;
  --muted: #66736c;
  --green: #356859;
  --green-dark: #285146;
  --green-pale: #e7efe9;
  --orange: #d96d46;
  --orange-dark: #b85131;
  --orange-pale: #f9e9df;
  --line: #d9ded8;
  --shadow: 0 18px 55px rgba(41, 57, 50, 0.11);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input {
  min-height: 52px;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 4px solid #f2ad57;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 10px 16px;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  min-height: 82px;
  margin: 0 auto;
  padding: 14px 30px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  color: white;
  background: var(--orange);
  border-radius: 50% 50% 45% 55%;
  font-size: 22px;
  place-items: center;
  transform: rotate(-5deg);
}

.brand-mark::first-letter {
  transform: rotate(5deg);
}

.header-link {
  padding: 10px 2px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.picker-section {
  position: relative;
  overflow: hidden;
  min-height: 660px;
  padding: 68px 24px 82px;
  background:
    radial-gradient(circle at 12% 18%, rgba(217, 109, 70, 0.1) 0 3px, transparent 4px),
    radial-gradient(circle at 85% 74%, rgba(53, 104, 89, 0.13) 0 4px, transparent 5px),
    linear-gradient(135deg, #f9f4e9 0%, #f1eee4 100%);
  background-size: 52px 52px, 78px 78px, auto;
}

.picker-section::before,
.picker-section::after {
  position: absolute;
  width: 240px;
  height: 240px;
  border: 2px solid rgba(53, 104, 89, 0.12);
  border-radius: 50%;
  content: "";
}

.picker-section::before {
  top: 110px;
  left: -150px;
}

.picker-section::after {
  right: -110px;
  bottom: -90px;
  width: 310px;
  height: 310px;
  border-color: rgba(217, 109, 70, 0.13);
}

.picker-copy,
.picker-card,
.dishes-section {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin-right: auto;
  margin-left: auto;
}

.picker-copy {
  margin-bottom: 30px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

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

h1,
h2 {
  font-family: "Fraunces", Georgia, serif;
}

h1 {
  max-width: 700px;
  margin: 0 auto 12px;
  font-size: clamp(42px, 6vw, 66px);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.intro {
  max-width: 630px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 18px;
}

.picker-card {
  padding: 34px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.filters {
  display: grid;
  grid-template-columns: 1fr 34px 1fr 34px 1.2fr;
  gap: 12px;
  align-items: end;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.field label span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  padding: 0 16px;
  color: var(--ink);
  background-color: white;
  border: 2px solid var(--line);
  border-radius: 12px;
}

.field input:focus,
.field select:focus {
  border-color: var(--green);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 17px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.field select {
  padding-right: 45px;
  appearance: none;
}

.filter-plus {
  display: grid;
  height: 52px;
  color: var(--muted);
  font-size: 28px;
  place-items: center;
}

.match-count {
  min-height: 26px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

.result {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 146px;
  margin: 10px 0 22px;
  padding: 24px 28px;
  gap: 24px;
  align-items: center;
  background: var(--green-pale);
  border: 1px solid #d5e2d9;
  border-radius: 18px;
}

.marquee-lights {
  position: absolute;
  inset: 5px;
  border: 2px dotted transparent;
  border-radius: 14px;
  pointer-events: none;
}

.result.is-choosing {
  background:
    linear-gradient(110deg, transparent 15%, rgba(255, 255, 255, 0.75) 45%, transparent 72%),
    var(--orange-pale);
  background-size: 220% 100%, auto;
  border-color: #e8aa83;
  box-shadow: 0 10px 28px rgba(184, 81, 49, 0.14);
  animation: game-show-shine 750ms linear infinite;
}

.result.is-choosing .marquee-lights {
  border-color: var(--orange);
  animation: marquee-blink 420ms steps(2, end) infinite;
}

.result.is-choosing .plate-icon {
  border-color: var(--orange);
  box-shadow: inset 0 0 0 8px var(--orange-pale);
  animation: plate-spin 700ms linear infinite;
}

.result.is-choosing .plate-icon span {
  background: var(--orange);
}

.result.is-choosing .result-kicker {
  color: var(--orange-dark);
}

.result.is-choosing .result-tags {
  visibility: hidden;
}

.result-name-shuffle {
  animation: rolodex-flip 130ms ease-out;
}

@keyframes rolodex-flip {
  0% { opacity: 0; transform: translateY(-20px) rotateX(35deg); }
  100% { opacity: 1; transform: translateY(0) rotateX(0); }
}

@keyframes game-show-shine {
  from { background-position: 180% 0, 0 0; }
  to { background-position: -120% 0, 0 0; }
}

@keyframes marquee-blink {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes plate-spin {
  to { transform: rotate(360deg); }
}

.result.is-picked {
  background: var(--orange-pale);
  border-color: #f0d4c4;
  animation: reveal 420ms ease-out;
}

.result.is-picked .marquee-lights {
  border-color: rgba(217, 109, 70, 0.35);
}

@keyframes reveal {
  0% { opacity: 0.4; transform: scale(0.985); }
  100% { opacity: 1; transform: scale(1); }
}

.plate-icon {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 86px;
  height: 86px;
  background: var(--paper);
  border: 3px solid var(--green);
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px var(--green-pale);
  place-items: center;
}

.result.is-picked .plate-icon {
  border-color: var(--orange);
  box-shadow: inset 0 0 0 8px var(--orange-pale);
}

.plate-icon span {
  width: 28px;
  height: 28px;
  background: var(--green);
  border-radius: 50% 45% 55% 48%;
  opacity: 0.75;
}

.result.is-picked .plate-icon span {
  background: var(--orange);
}

.result-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  perspective: 500px;
}

.result-kicker {
  margin-bottom: 4px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result.is-picked .result-kicker {
  color: var(--orange-dark);
}

.result h2 {
  margin-bottom: 6px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
}

.result-tags,
.dish-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  padding: 3px 10px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(53, 104, 89, 0.2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.primary-button,
.secondary-button,
.text-button,
.delete-button,
.icon-button {
  border: 0;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 62px;
  padding: 12px 24px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: white;
  background: var(--green);
  border-radius: 13px;
  box-shadow: 0 7px 0 var(--green-dark);
  font-size: 20px;
  font-weight: 800;
  transition: transform 130ms ease, box-shadow 130ms ease, background 130ms ease;
}

.primary-button:hover {
  background: #2f5d50;
  transform: translateY(-1px);
}

.primary-button:active {
  box-shadow: 0 3px 0 var(--green-dark);
  transform: translateY(4px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.primary-button.is-choosing {
  opacity: 1;
  background: var(--orange);
  box-shadow: 0 7px 0 var(--orange-dark);
}

.primary-button.is-choosing span {
  animation: button-star-spin 650ms linear infinite;
}

@keyframes button-star-spin {
  to { transform: rotate(360deg); }
}

.button-help {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.dishes-section {
  max-width: 980px;
  padding: 80px 24px 90px;
}

.section-heading {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin-bottom: 4px;
  font-size: clamp(36px, 5vw, 48px);
  line-height: 1.1;
}

.section-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.secondary-button {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 54px;
  padding: 10px 20px;
  gap: 8px;
  align-items: center;
  color: white;
  background: var(--orange);
  border-radius: 12px;
  font-weight: 800;
}

.secondary-button:hover {
  background: var(--orange-dark);
}

.secondary-button span {
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.add-form {
  margin: -6px 0 34px;
  padding: 28px;
  background: var(--paper);
  border: 2px solid #e5c5b3;
  border-radius: var(--radius);
  box-shadow: 0 14px 35px rgba(65, 54, 44, 0.08);
}

.add-form[hidden] {
  display: none;
}

.form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.form-heading h3 {
  margin-bottom: 2px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 27px;
}

.form-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.icon-button {
  display: grid;
  width: 48px;
  height: 48px;
  min-height: 48px;
  color: var(--ink);
  background: var(--cream);
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
  place-items: center;
}

.add-form-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 16px;
}

.effort-field {
  grid-column: 2 / 4;
}

.form-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
}

.save-button {
  width: auto;
  min-width: 210px;
  min-height: 54px;
  font-size: 17px;
  box-shadow: none;
}

.text-button {
  padding: 10px;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.notice {
  margin: -8px 0 24px;
  padding: 14px 18px;
  color: var(--green-dark);
  background: var(--green-pale);
  border-radius: 10px;
  font-weight: 700;
}

.dish-toolbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.search-field {
  display: flex;
  width: min(100%, 390px);
  align-items: center;
  background: white;
  border: 2px solid var(--line);
  border-radius: 12px;
}

.search-field:focus-within {
  border-color: var(--green);
  outline: 4px solid #f2ad57;
  outline-offset: 3px;
}

.search-field > span:first-child {
  padding-left: 16px;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
}

.search-field input {
  width: 100%;
  padding: 0 14px 0 9px;
  border: 0;
  outline: 0;
  background: transparent;
}

.dish-count {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.dish-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.dish-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  min-width: 0;
  min-height: 104px;
  margin: 0;
  padding: 18px;
  gap: 14px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.dish-item:hover {
  border-color: #aebbb4;
  box-shadow: 0 7px 20px rgba(52, 69, 61, 0.07);
  transform: translateY(-1px);
}

.dish-item-icon {
  display: grid;
  width: 47px;
  height: 47px;
  background: var(--green-pale);
  border-radius: 13px;
  font-size: 21px;
  place-items: center;
}

.dish-item-copy {
  min-width: 0;
}

.dish-item h3 {
  overflow: hidden;
  margin-bottom: 7px;
  font-size: 17px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dish-item .tag {
  padding: 2px 8px;
  color: var(--muted);
  background: var(--cream);
  border-color: transparent;
  font-size: 11px;
}

.delete-button {
  display: grid;
  width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 9px;
  font-size: 26px;
  place-items: center;
}

.delete-button:hover {
  color: #8d321f;
  background: var(--orange-pale);
}

.delete-label {
  display: none;
}

.empty-state {
  padding: 55px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state > div {
  margin-bottom: 10px;
  font-size: 42px;
}

.empty-state h3 {
  margin-bottom: 4px;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: 27px;
}

footer {
  padding: 30px 24px;
  color: #dbe5df;
  background: var(--ink);
  text-align: center;
}

footer p {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  .site-header {
    min-height: 70px;
    padding: 10px 17px;
  }

  .brand {
    gap: 9px;
    font-size: 18px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .header-link {
    display: none;
  }

  .picker-section {
    min-height: auto;
    padding: 45px 15px 58px;
  }

  h1 {
    font-size: clamp(39px, 12vw, 52px);
  }

  .intro {
    font-size: 17px;
  }

  .picker-card {
    padding: 22px 17px 24px;
    border-radius: 21px;
  }

  .filters {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .filter-plus {
    display: none;
  }

  .result {
    min-height: 124px;
    padding: 20px;
    gap: 16px;
  }

  .plate-icon {
    width: 62px;
    height: 62px;
    border-width: 2px;
    box-shadow: inset 0 0 0 6px var(--green-pale);
  }

  .result.is-picked .plate-icon {
    box-shadow: inset 0 0 0 6px var(--orange-pale);
  }

  .result.is-choosing .plate-icon {
    box-shadow: inset 0 0 0 6px var(--orange-pale);
  }

  .plate-icon span {
    width: 21px;
    height: 21px;
  }

  .result h2 {
    font-size: 27px;
  }

  .primary-button {
    min-height: 64px;
    font-size: 19px;
  }

  .dishes-section {
    padding: 58px 16px 70px;
  }

  .section-heading {
    display: block;
    margin-bottom: 26px;
  }

  .secondary-button {
    width: 100%;
    margin-top: 20px;
    justify-content: center;
  }

  .add-form {
    padding: 21px 17px;
  }

  .add-form-grid {
    grid-template-columns: 1fr;
  }

  .effort-field {
    grid-column: auto;
  }

  .form-actions {
    display: block;
  }

  .save-button {
    width: 100%;
  }

  .text-button {
    width: 100%;
    margin-top: 10px;
  }

  .dish-toolbar {
    display: block;
  }

  .search-field {
    width: 100%;
  }

  .dish-count {
    display: block;
    margin-top: 10px;
  }

  .dish-list {
    grid-template-columns: 1fr;
  }

  .dish-item {
    min-height: 108px;
  }

  .delete-button {
    display: flex;
    width: auto;
    padding: 0 8px;
    gap: 4px;
    align-items: center;
    font-size: 22px;
  }

  .delete-label {
    display: inline;
    font-size: 12px;
    font-weight: 700;
  }
}

@media (max-width: 390px) {
  .result {
    display: block;
    text-align: center;
  }

  .plate-icon {
    margin: 0 auto 12px;
  }

  .result-tags {
    justify-content: center;
  }

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

  .dish-item-icon {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
