* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f8f1;
  color: #203f37;
  font: 17px system-ui,sans-serif;
}

header {
  border-bottom: 1px solid #c9d2c3;
  padding: 18px 6vw;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
}

header .home-link {
  text-decoration: none;
  background: #214c42;
  color: white;
  padding: 7px 13px;
  border-radius: 8px;
  letter-spacing: -1px;
}

header span[aria-hidden] {
  color: #608075;
  font-size: 14px;
}

main {
  max-width: 1120px;
  margin: 42px auto;
  padding: 0 25px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

h1,h2 {
  font-family: Georgia,serif;
  font-weight: normal;
  letter-spacing: -.055em;
  margin: 0;
}

h1 {
  font-size: clamp(50px,6vw,82px);
  line-height: .98;
}

h1 i {
  color: #487962;
}

p {
  line-height: 1.55;
}

form {
  margin: 30px 0 18px;
}

label {
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

input,button,a {
  font: inherit;
}

input {
  width: 100%;
  padding: 14px;
  border: 1px solid #879c8c;
  border-radius: 9px;
  background: white;
}

button {
  cursor: pointer;
  color: inherit;
  border: 1px solid #aab9a7;
  border-radius: 20px;
  background: white;
  padding: 7px 13px;
}

button:hover {
  filter: brightness(.94);
}

.add,.match {
  font-weight: bold;
  border: 0;
  border-radius: 9px;
}

.add {
  background: #d8ecad;
  margin-top: 8px;
}

.match {
  background: #244f41;
  color: white;
  padding: 15px 24px;
  width: 100%;
  margin-top: 18px;
}

.ideas {
  display: flex;
  margin: 1em 0;
  gap: 7px;
  flex-wrap: wrap;
}

.ideas button {
  font-size: 14px;
}

.stage {
  background-color: #e2ebdc;
  background-image: radial-gradient(#afc3a9 1px,transparent 1px);
  background-size: 16px 16px;
  border-radius: 24px;
  padding: 22px;
  text-align: center;
  border: 1px solid #c3d0bc;
}

.stageTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.count {
  background: #fff9;
  border-radius: 18px;
  padding: 5px 12px;
  font-size: 14px;
}

.jar {
  position: relative;
  width: min(100%,295px);
  margin: 48px auto 24px;
}

.lid {
  width: 80%;
  height: 30px;
  margin: auto;
  border: 3px solid #456251;
  border-radius: 9px;
  background: repeating-linear-gradient(90deg,#829986 0 4px,#acbfaa 5px 9px);
  box-shadow: 0 4px #536f5a;
}

.glass {
  height: 275px;
  border: 4px solid #617e6b;
  border-radius: 25% 25% 15% 15% / 14% 14% 10% 10%;
  background: linear-gradient(100deg,#ffffffa8,#d8eee55c 40%,#fafff7a6);
  box-shadow: inset 8px 0 #ffffff80,inset -7px -7px #bdcfc18c,0 13px 0 -5px #b8cbb5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: auto;
}

.glass:has(.note) {
  align-items: end;
}

.empty {
  transform: rotate(-7deg);
  font: italic 26px Georgia;
  color: #607965;
  background: #fff4bf;
  padding: 15px;
  box-shadow: 2px 3px #75877233;
}

.notes {
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.note {
  border: 0;
  border-radius: 3px;
  padding: 8px;
  max-width: 100%;
  overflow-wrap: anywhere;
  background: #f9dda6;
  box-shadow: 1px 2px #63776533;
  animation: drop .36s ease-out;
}

.note:nth-child(3n+2) {
  background: #e0d3f0;
}

.note:nth-child(3n) {
  background: #c9e5ee;
}

@keyframes drop {
  from {
    transform: translateY(-35px) rotate(-7deg);
    opacity: 0;
  }
}

small {
  font-size: 14px;
}

#status {
  min-height: 20px;
  font-size: 14px;
  color: #496753;
  margin: 8px 0;
}

dialog {
  width: min(90%,490px);
  border: 1px solid #789280;
  border-radius: 20px;
  padding: 32px;
  background: #f8faef;
  color: inherit;
}

dialog::backdrop {
  background: #142f27a8;
}

dialog h2 {
  font-size: 42px;
}

dialog a {
  color: #255e49;
}

[data-edition="major-jar"] dialog {
  width: min(92%, 600px);
  max-height: 86vh;
  max-height: 86dvh;
  padding: clamp(18px, 4vw, 32px);
  overflow: auto;
}

#matches article {
  padding: 16px 0 20px;
  border-top: 1px solid #c5d0c1;
  overflow-wrap: anywhere;
}

#matches h3,
#matches p {
  margin: 0 0 .4em;
}

#matches summary {
  cursor: pointer;
  width: fit-content;
}

#matches summary:focus-visible {
  outline: 3px solid #915d20;
  outline-offset: 2px;
}

#matches .challenge {
  margin: .25em 0 0;
}

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid #915d20;
  outline-offset: 2px;
}

@media(max-width:760px) {
  main {
    grid-template-columns: 1fr;
    margin: 26px auto;
    gap: 18px;
  }
  .jar {
    margin-top: 24px;
  }
  .glass {
    height: 220px;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    animation: none!important;
  }
}
