* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
:root {
  color-scheme: light;
  --ink: #132c2a;
  --paper: #fbf8ee;
  --green: #185a47;
  --lime: #e6ee9a;
  --rule: #b4bca6;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    1rem/1.5 "DM Sans",
    Arial,
    sans-serif;
}
a {
  color: var(--green);
  text-underline-offset: 0.18em;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
textarea:focus-visible {
  outline: 3px solid #b34913;
  outline-offset: 3px;
}
#clue:focus, #solution:focus {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  background: white;
  padding: 8px;
}
.skip:focus {
  top: 8px;
}
.wrap {
  width: min(100% - 36px, 700px);
  margin: auto;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--ink);
  padding: 16px 0;
}
.wordmark a {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 32px 0 23px;
}
h1,
h2,
p {
  margin: 0;
}
h1,
#solution {
  font:
    400 clamp(3.45rem, 10vw, 5.2rem) / 0.98 "DM Serif Text",
    Georgia,
    serif;
  letter-spacing: -0.055em;
}
.intro p {
  margin-top: 10px;
}
.monogram {
  display: flex;
  align-items: center;
  padding-right: 4px;
}
.monogram i {
  display: grid;
  place-items: center;
  width: clamp(32px, 7vw, 54px);
  aspect-ratio: 1;
  font:
    400 clamp(1.8rem, 5vw, 2.9rem) / 1 "DM Serif Text",
    serif;
  color: var(--ink);
  background: var(--lime);
  border: 1px solid var(--green);
  transform: rotate(-10deg);
}
.monogram i + i {
  background: var(--green);
  color: white;
  transform: translateY(10px) rotate(9deg);
}
#puzzle {
  background: #fffef8;
  border: 1px solid #9ba88e;
  border-radius: 5px;
  padding: clamp(17px, 4vw, 31px);
  box-shadow: 0 4px 0 #daddc8;
}
.edition,
.assist,
.result-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.edition {
  justify-content: space-between;
  gap: 5px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 12px;
  font-size: 0.83rem;
  font-weight: 700;
}
.edition time {
  font-weight: 400;
}
.clue-block {
  margin: 23px 0 19px;
}
.clue-block p,
#outcome {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}
.clue-block h2 {
  margin-top: 6px;
  font:
    400 clamp(1.55rem, 4vw, 2.15rem) / 1.2 "DM Serif Text",
    Georgia,
    serif;
  letter-spacing: -0.022em;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
legend,
label {
  font-weight: 600;
  font-size: 0.91rem;
}
#rack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 17px;
}
#rack button {
  width: clamp(44px, 8vw, 57px);
  height: clamp(47px, 8vw, 61px);
  border: 1px solid #75826c;
  border-radius: 3px;
  background: var(--lime);
  box-shadow: 0 2px #84916e;
  font:
    400 1.95rem/1 "DM Serif Text",
    Georgia,
    serif;
}
#rack button[aria-disabled="true"] {
  background: #eef0e6;
  color: #697361;
  box-shadow: none;
  border-style: dashed;
}
.entry {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}
.entry input,
textarea {
  min-width: 0;
  flex: 1;
  border: 1px solid #7c8a76;
  background: white;
  border-radius: 3px;
  padding: 9px 12px;
}
.primary,
#confirm button {
  border: 0;
  background: var(--green);
  color: white;
  padding: 10px 15px;
  min-height: 44px;
  border-radius: 3px;
  font-weight: 700;
}
.assist {
  gap: 2px 15px;
}
.assist button {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 44px;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#confirm,
#hint-text {
  background: #eef0dc;
  padding: 10px;
  border-radius: 3px;
  margin-top: 6px;
}
#confirm p {
  margin-bottom: 7px;
}
#confirm button:last-child {
  background: white;
  color: var(--green);
  border: 1px solid var(--green);
}
#status:not(:empty) {
  margin-top: 10px;
  font-weight: 600;
}
#solution {
  font-size: 3rem;
  margin: 4px 0 10px;
}
#meaning {
  margin-bottom: 8px;
}
#new-round, #first-result {
  margin-top: 12px;
}
#replay {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--green);
  border-radius: 3px;
  background: transparent;
  color: var(--green);
  font-weight: 700;
}
.result-actions {
  margin-top: 20px;
  gap: 16px;
}
#share-text {
  width: 100%;
  margin-top: 10px;
}
footer {
  padding: 24px 0 32px;
  color: #415449;
  font-size: 0.9rem;
}
footer p,
footer details {
  margin-bottom: 12px;
}
footer summary,
footer a {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}
footer summary {
  display: list-item;
  line-height: 42px;
}
footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (max-width: 350px) {
  .wrap {
    width: calc(100% - 24px);
  }
  .entry {
    flex-wrap: wrap;
  }
  .entry input {
    width: 100%;
  }
  .monogram {
    display: none;
  }
}

/* Motion: tiles deal in, taps pop, wrong answers shake and a solved word lands letter by letter. */
#rack button, .primary, #replay, #confirm button {
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .14s cubic-bezier(.34, 1.56, .64, 1);
}
#rack button:not([aria-disabled="true"]):hover { transform: translateY(-2px); box-shadow: 0 4px #84916e; }
#rack button:active, .primary:active, #replay:active { transform: scale(.94); }
#rack button[aria-disabled="true"] { transform: scale(.94); }
#rack.deal button { animation: deal .42s calc(var(--i) * 45ms) cubic-bezier(.34, 1.56, .64, 1) both; }
#rack.wiggle button { animation: wiggle .4s calc(var(--i) * 25ms) ease-in-out; }
#rack button.tap { animation: tap .22s ease-out; }
#rack button.nope { animation: nope .25s ease-in-out; }
.entry.shake { animation: shake .42s ease-in-out; }
#hint-text, #confirm { animation: slide .3s cubic-bezier(.2, .8, .2, 1) both; }
#result.reveal { animation: slide .45s cubic-bezier(.2, .8, .2, 1) both; }
#solution span { display: inline-block; }
#result.reveal #solution span { animation: land .5s calc(120ms + var(--i) * 55ms) cubic-bezier(.34, 1.56, .64, 1) both; }
.monogram.cheer i { animation: cheer .7s cubic-bezier(.34, 1.56, .64, 1); }
.monogram.cheer i + i { animation-delay: .1s; }
@keyframes deal { from { opacity: 0; transform: translateY(14px) rotate(-6deg) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes wiggle { 0%, 100% { transform: none; } 30% { transform: rotate(-5deg); } 60% { transform: rotate(4deg); } }
@keyframes tap { 50% { transform: scale(.86); } }
@keyframes nope { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes land { from { opacity: 0; transform: translateY(-18px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes cheer { 40% { transform: translateY(-10px) rotate(14deg) scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
