* {
  box-sizing: border-box;
}

:root {
  --green: #4f8d68;
  --green-dark: #356b4d;
  --bg: #faf9f4;
  --text: #292b25;
  --muted: #716f62;
  --red: #f4433d;
  --blue: #397fe8;
  --glass: #25bf62;
  --metal: #f3a509;
  --border: #e6e2d8;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Trebuchet MS", Arial, sans-serif;
}

button {
  font: inherit;
}

.app {
  width: min(1200px, 100%);
  min-height: 100vh;
  margin: auto;
  padding: 38px 32px 45px;
}

.screen {
  display: none;
  min-height: calc(100vh - 83px);
  align-items: center;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

.brand {
  text-align: center;
  margin: 12px 0 28px;
}

.brand-icon,
.result-icon {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  margin: auto;
  font-size: 74px;
}

.brand h1 {
  margin: 26px 0 4px;
  color: var(--green);
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1;
}

.brand p {
  margin: 14px 0 0;
  color: #625f52;
  font-size: clamp(21px, 2.5vw, 29px);
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: 0 14px 30px rgba(70, 66, 51, .10);
}

.instructions {
  width: min(780px, 100%);
  padding: 36px 44px;
}

.instructions h2 {
  margin: 0 0 25px;
  font-size: 29px;
}

.instructions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.instructions li {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin: 20px 0;
  color: #666356;
  font-size: 20px;
  line-height: 1.45;
}

.instructions li span {
  width: 34px;
  flex: 0 0 34px;
  text-align: center;
}

.primary-btn {
  border: 0;
  border-radius: 42px;
  padding: 19px 54px;
  margin: 34px 0 27px;
  background: var(--green);
  color: white;
  font-weight: 700;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(79, 141, 104, .25);
  transition: transform .15s, background .15s;
}

.primary-btn:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  color: #666356;
  font-size: 19px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.dot {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: inline-block;
}

.dot.plastic { background: var(--red); }
.dot.paper { background: var(--blue); }
.dot.glass { background: var(--glass); }
.dot.metal { background: var(--metal); }

.game-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 21px;
  color: #5e5c51;
  margin-bottom: 22px;
}

.game-header strong {
  color: var(--text);
}

.feedback {
  width: 100%;
  border-radius: 16px;
  padding: 17px 24px;
  margin-bottom: 22px;
  font-size: 19px;
  font-weight: 700;
  border: 1px solid transparent;
}

.feedback.success {
  background: #e9f7ee;
  color: #2e7650;
  border-color: #b9dfc6;
}

.feedback.error {
  background: #fdeceb;
  color: #c44039;
  border-color: #ecc4c0;
}

.feedback.hidden {
  display: none;
}

.bins {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}

.bin {
  border: 0;
  min-height: 185px;
  border-radius: 26px;
  color: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-weight: 700;
  font-size: 21px;
  transition: transform .15s, box-shadow .15s;
}

.bin:hover,
.bin.drag-over {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(0,0,0,.14);
}

.bin.plastic { background: var(--red); }
.bin.paper { background: var(--blue); }
.bin.glass { background: var(--glass); }
.bin.metal { background: var(--metal); }

.bin-icon {
  font-size: 53px;
  filter: grayscale(1) brightness(0) invert(1);
}

.instruction-title {
  width: 100%;
  margin: 0 0 8px;
  font-size: 24px;
}

.mobile-hint {
  width: 100%;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
}

.items {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.item {
  min-height: 205px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 21px;
  padding: 22px;
  cursor: grab;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  color: #69665a;
  box-shadow: 0 5px 13px rgba(70,66,51,.05);
  user-select: none;
  transition: transform .15s, opacity .15s, border .15s;
}

.item:hover {
  transform: translateY(-2px);
}

.item.selected {
  border: 3px solid var(--green);
  transform: translateY(-2px);
}

.item.dragging {
  opacity: .45;
}

.item.used {
  visibility: hidden;
  pointer-events: none;
}

.item-emoji {
  font-size: 65px;
}

.item-name {
  font-size: 19px;
  text-align: center;
}

.score-area {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-top: 27px;
  margin-bottom: 20px;
}

.score-area > strong {
  color: var(--green);
  font-size: 30px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: #666356;
  cursor: pointer;
  font-size: 18px;
}

.result-icon {
  margin-top: 20px;
}

#resultTitle {
  color: var(--green);
  font-size: clamp(42px, 6vw, 62px);
  margin: 28px 0 6px;
}

#resultMessage {
  color: #625f52;
  font-size: 22px;
  margin: 0 0 32px;
}

.result-card {
  width: min(690px, 100%);
  padding: 48px;
  text-align: center;
}

.result-card > span {
  color: #777466;
  font-size: 20px;
}

.result-card > strong {
  display: block;
  color: var(--green);
  font-size: 88px;
  line-height: 1.05;
  margin: 20px 0 10px;
}

.result-card > small {
  color: #777466;
  font-size: 18px;
}

.result-card hr {
  border: 0;
  border-top: 1px solid #e4e0d7;
  margin: 32px 0;
}

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #716e61;
  font-size: 19px;
  margin: 17px 0;
}

.result-row strong {
  color: #2e2e28;
}

@media (max-width: 850px) {
  .app {
    padding: 25px 18px 35px;
  }

  .bins,
  .items {
    grid-template-columns: repeat(2, 1fr);
  }

  .bin {
    min-height: 145px;
  }

  .instructions {
    padding: 28px 25px;
  }
}

@media (max-width: 560px) {
  .brand-icon,
  .result-icon {
    width: 110px;
    height: 110px;
    font-size: 53px;
  }

  .brand h1 {
    font-size: 42px;
  }

  .brand p {
    font-size: 19px;
  }

  .instructions li {
    font-size: 17px;
  }

  .bins,
  .items {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .bin {
    min-height: 120px;
    font-size: 17px;
    border-radius: 18px;
  }

  .bin-icon {
    font-size: 38px;
  }

  .item {
    min-height: 160px;
    padding: 13px;
  }

  .item-emoji {
    font-size: 48px;
  }

  .item-name {
    font-size: 16px;
  }

  .game-header {
    font-size: 16px;
  }

  .instruction-title {
    font-size: 20px;
  }

  .score-area {
    flex-direction: column;
    gap: 12px;
  }

  .result-card {
    padding: 30px 22px;
  }

  .result-card > strong {
    font-size: 68px;
  }
}
