:root {
  color-scheme: light;
  --green: #2e7d32;
  --lime: #81c784;
  --cream: #fff8e1;
  --ink: #23352a;
  --muted: #64736a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9, #fff8e1);
  color: var(--ink);
  font:
    16px/1.45 ui-rounded,
    'SF Pro Rounded',
    system-ui,
    sans-serif;
}
.app {
  width: min(1120px, 100%);
  margin: auto;
  padding: 14px clamp(12px, 3vw, 30px) 45px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
header > a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: white;
  color: var(--green);
  text-decoration: none;
  font-size: 20px;
  box-shadow: 0 5px 18px #214d2920;
}
header > div {
  text-align: center;
}
header > div span {
  font-size: 28px;
}
header > div b {
  display: block;
  color: var(--green);
}
select {
  padding: 10px;
  border: 2px solid #b8d7b8;
  border-radius: 14px;
  background: white;
  color: var(--ink);
}
.hero {
  text-align: center;
}
.hero h1 {
  margin: 3px;
  color: var(--green);
  font-size: clamp(29px, 5vw, 48px);
}
.hero p {
  margin: 4px 0 15px;
  color: var(--muted);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.toolbar > div {
  padding: 9px 15px;
  border-radius: 14px;
  background: #ffffffc4;
}
.toolbar b {
  color: #e65100;
}
.game {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(420px, 1fr);
  gap: 22px;
  margin-top: 20px;
}
.panel {
  padding: 16px;
  border-radius: 24px;
  background: #ffffffdd;
  box-shadow: 0 10px 35px #244b2c17;
}
.panel h2 {
  text-align: center;
  color: var(--green);
}
.helper {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.foods {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  min-height: 240px;
}
.food {
  width: 78px;
  height: 78px;
  padding: 4px;
  border: 2px solid #c8e6c9;
  border-radius: 14px;
  background: #fafafa;
  color: var(--ink);
  cursor: grab;
}
.food span {
  display: block;
  font-size: 30px;
}
.food small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.food.selected {
  border-color: #f59e0b;
  background: #fff1bd;
  transform: translateY(-4px);
  box-shadow: 0 7px 18px #c7832140;
}
.plate {
  position: relative;
  width: min(480px, 100%);
  aspect-ratio: 1;
  margin: auto;
  overflow: hidden;
  border: 11px solid #ffcc80;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: inset 0 0 30px #6b4d2220;
}
.zone {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 5px;
  padding: 35px 12px 12px;
  border: 0;
  color: var(--ink);
  cursor: pointer;
}
.zone.over,
.zone:hover {
  filter: saturate(1.4);
  box-shadow: inset 0 0 35px #2e7d3255;
}
.veg {
  inset: 0 0 50% 0;
  background: #c8e6c9;
  border-bottom: 3px dashed #66bb6a;
}
.protein {
  inset: 50% 50% 0 0;
  background: #ffcdd2;
  border-right: 3px dashed #ef9a9a;
}
.grain {
  inset: 50% 0 0 50%;
  background: #ffe6a2;
}
.zone-label {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 12px;
  background: #fffd;
  font-weight: 800;
}
.placed {
  font-size: clamp(25px, 4vw, 38px);
  filter: drop-shadow(0 3px 3px #0002);
}
.tip {
  max-width: 780px;
  min-height: 50px;
  margin: 18px auto 0;
  padding: 13px 16px;
  border-left: 5px solid var(--green);
  border-radius: 0 14px 14px 0;
  background: #dff0df;
  color: #1b5e20;
}
.message {
  min-height: 30px;
  margin-top: 10px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
}
.message.success {
  color: #1565c0;
}
.message.error {
  color: #c62828;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 4px;
}
.controls button,
.modal button {
  padding: 11px 22px;
  border: 0;
  border-radius: 22px;
  background: #558b2f;
  color: white;
  font-weight: 800;
  cursor: pointer;
}
.controls .primary {
  background: var(--green);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: #0008;
}
.overlay.show {
  display: grid;
}
.modal {
  width: min(380px, 100%);
  padding: 30px;
  border-radius: 25px;
  background: white;
  text-align: center;
}
.modal > div {
  font-size: 55px;
}
.modal h2 {
  color: var(--green);
}
@media (max-width: 800px) {
  .game {
    grid-template-columns: 1fr;
  }
  .foods-panel,
  .plate-panel {
    width: min(100%, 480px);
    margin: auto;
  }
  .plate {
    width: min(390px, 100%);
  }
}
@media (max-width: 430px) {
  .app {
    padding-inline: 9px;
  }
  .panel {
    padding: 10px;
  }
  .food {
    width: 70px;
    height: 70px;
  }
  .plate {
    border-width: 8px;
  }
  .zone-label {
    font-size: 12px;
  }
  .zone {
    padding: 30px 5px 5px;
  }
  header > div b {
    font-size: 13px;
  }
}
