:root {
  color-scheme: light;
  --ink: #352545;
  --muted: #71617a;
  --line: #e0d5c7;
  --paper: #fff9ed;
  --hint: #fff0ba;
  --accent: #ffce55;
  --display: "Trebuchet MS", ui-rounded, system-ui, sans-serif;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background-image: radial-gradient(#e6d9c4 0.8px, transparent 0.8px);
  background-size: 22px 22px;
}
.site-policies {
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  line-height: 2;
}
.site-policies a {
  display: inline-block;
  padding: 8px 4px;
  color: var(--ink);
  text-underline-offset: 3px;
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  touch-action: manipulation;
}
button,
input,
select,
textarea {
  border-radius: 12px;
}
button {
  border: 0;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
textarea:focus-visible {
  outline: 3px solid #8052c6;
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2 {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
p {
  line-height: 1.55;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 760px;
  margin: auto;
  padding: 20px 24px;
  background: var(--paper);
  border-bottom: 2px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 38px;
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 1;
}
.brand-name {
  position: relative;
  padding-bottom: 7px;
}
.brand-name::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 8%;
  width: 78%;
  height: 5px;
  background: #f38f76;
  border-radius: 50%;
  transform: rotate(-3deg);
}
.brand-y {
  display: inline-block;
  transform: rotate(-7deg);
}
.brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  transform: rotate(-8deg);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.total {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  padding: 7px 12px;
  border: 2px solid var(--ink);
  border-radius: 20px 20px 17px 20px;
  background: #ffe393;
  box-shadow: 0 2px 0 var(--ink);
}
.total strong {
  display: inline-block;
  font-size: 24px;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.total span {
  font-size: 12px;
  color: var(--muted);
}
.help-button {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: white;
  color: var(--ink);
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 2px 0 var(--ink);
}
main {
  max-width: 680px;
  margin: 0 auto;
  padding: 34px 20px 48px;
}
.connection-panel {
  margin-bottom: 26px;
}
h1 {
  max-width: 500px;
  margin: 0 auto 22px;
  font-size: 30px;
  text-align: center;
  text-wrap: balance;
}
.word-collection {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.word-collection li {
  min-width: 0;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 2px;
  border: 2px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 750;
}
.empty-word {
  color: #897a90;
  background: #f4eee4;
}
.empty-word[aria-current] {
  color: var(--ink);
  border: 2px solid var(--ink);
  background: #ffdfcf;
  box-shadow: 0 3px 0 var(--ink);
  transform: rotate(-3deg);
}
.collected-word {
  background: #e8dffa;
  color: #49356c;
  border-color: #b49ccf !important;
  box-shadow: 0 3px 0 #b49ccf;
}
.revealed-word {
  background: #f1ece4;
  color: var(--muted);
}
.revealed-word small {
  font-size: 9px;
  font-weight: 500;
}
.connection-actions {
  margin-top: 14px;
  text-align: center;
}
.connection-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 10px;
  color: var(--ink);
  background: var(--accent);
  font-size: 15px;
  font-weight: 750;
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  border-radius: 16px;
}
.connection-button:disabled {
  border: 0;
  box-shadow: none;
  background: transparent;
  min-height: 30px;
  padding: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 450;
}
.connection-button:not(:disabled):hover {
  background: #ffda7c;
}
.connection-status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
#connection-reveal {
  text-align: center;
  margin-top: 6px;
}
#connection-answer {
  font-size: 23px;
}
#connection-explanation {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}
#connection-form {
  margin-top: 16px;
}
#connection-form label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 8px;
}
#connection-form .text-button {
  margin-top: 6px;
}
#reveal-connection {
  display: block;
  margin: 12px auto 0;
}
.play-area {
  position: relative;
  background: #fffefd;
  border: 2px solid var(--ink);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 5px 6px 0 #edc675;
}
.play-area::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 26px;
  width: 38px;
  height: 13px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #f7a18b;
  transform: rotate(6deg);
}
#clue {
  font-size: 26px;
  margin-bottom: 24px;
  scroll-margin-top: 100px;
}
#clue:focus,
#summary:focus {
  outline: none;
}
.clue-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 10px;
}
.clue-list-heading strong {
  font-weight: 600;
}
#attempt-count {
  color: var(--muted);
  white-space: nowrap;
}
.clue-list {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}
.hint {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 12px;
  background: #faf6f0;
}
.hint-number {
  font-size: 11px;
  font-weight: 700;
  color: #826c46;
}
.hint p {
  font-size: 16px;
  line-height: 1.45;
}
.hint.latest {
  background: var(--hint);
  border: 1px solid #efcf76;
}
.hint.latest p {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.answer-controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
input {
  min-width: 0;
  width: 100%;
  padding: 14px;
  background: white;
  color: var(--ink);
  border: 1.5px solid #beafcb;
  font-size: 16px;
}
input::placeholder {
  color: #807289;
  opacity: 1;
}
.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  background: #5f3b96;
  color: white;
  font-weight: 750;
  white-space: nowrap;
  border-radius: 15px;
  box-shadow: 0 3px 0 var(--ink);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}
.primary:active,
.connection-button:not(:disabled):active,
.help-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}
.primary:hover {
  background: #6a49a6;
}
.text-button {
  padding: 10px 6px;
  min-height: 44px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.text-button:hover {
  color: #6a49a6;
}
.muted {
  color: var(--muted);
}
#give-up {
  display: block;
  margin: 18px auto -10px;
}
.notice:not(:empty):not(.sr-only) {
  margin-top: 12px;
  font-size: 13px;
  color: #a03738;
}
#connection-notice {
  text-align: center;
}
.discovery-panel {
  margin-top: 18px;
}
#bank-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.discovery-panel h3,
#guesses-title {
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
}
.discovery-panel h3 {
  flex: 0 0 auto;
}
.bank-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.bank-letter {
  background: #e8dffa;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 700;
}
.new-discovery {
  box-shadow: inset 0 -2px #8d67c1;
}
#rescue-hint {
  margin-top: 10px;
  font-size: 13px;
}
#rescue-hint span {
  color: var(--muted);
  margin-right: 8px;
}
#guess-history {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.guess-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.guess-entry {
  display: flex;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
  padding: 5px 8px;
  background: #f6f0e7;
  border-radius: 6px;
  font-size: 12px;
}
.guess-number {
  color: var(--muted);
  font-size: 10px;
}
.guess-word {
  overflow-wrap: anywhere;
  letter-spacing: 0.05em;
}
.guess-word mark {
  background: #e7dcfb;
  color: #4d3274;
  font-weight: 700;
  border-radius: 2px;
}
.correct-guess {
  background: #e8dffa;
}
.reveal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: var(--hint);
  border-radius: 14px;
  margin: -8px 0 6px;
  border: 1px solid #efcf76;
}
.reveal strong,
#answer-reveal {
  display: block;
}
#award {
  font-size: 20px;
}
#answer-reveal {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.first-clue {
  background: #ffe3a0;
}
.solve-badge {
  color: #79531b;
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 8px;
}
#continue-shortcut {
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 22px;
}
.summary {
  text-align: center;
}
.finish-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  color: var(--ink);
  background: #ffd76b;
  border: 2px solid var(--ink);
  border-radius: 22px;
  transform: rotate(-8deg);
  box-shadow: 3px 3px 0 #ef987e;
  font-size: 38px;
}
.summary h2 {
  font-size: 27px;
}
#finish-caption {
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}
.final-score {
  margin: 20px 0;
}
.final-score strong,
.final-score span {
  display: block;
}
.final-score strong {
  font-size: 48px;
  letter-spacing: -0.06em;
}
.final-score span {
  color: var(--muted);
  font-size: 12px;
}
.results {
  margin-bottom: 22px;
}
.result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 13px;
  text-align: left;
}
.result-row b {
  flex: 1;
}
.result-row span {
  color: var(--muted);
  font-size: 12px;
}
.summary .text-button {
  display: block;
  margin: 6px auto 0;
}
#share-status {
  font-size: 13px;
  color: var(--muted);
}
#share-text {
  width: 100%;
  min-height: 180px;
  padding: 12px;
}
dialog {
  position: fixed;
  width: min(460px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  padding: 32px 26px 26px;
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 90px #35254533;
}
dialog::backdrop {
  background: #35254566;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font-size: 26px;
  max-width: 290px;
  padding-right: 20px;
}
.close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  width: 44px;
  height: 44px;
}
.rules-steps {
  list-style: decimal;
  padding-left: 20px;
  margin: 20px 0;
}
.rules-steps li {
  padding-left: 4px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.55;
}
.rules-steps li::marker {
  color: #7954a7;
  font-weight: 800;
}
.more-rules {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  font-size: 13px;
}
.more-rules summary {
  cursor: pointer;
  min-height: 28px;
}
.more-rules p {
  color: var(--muted);
  margin-bottom: 10px;
}
.theme-select {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  padding: 8px 0 20px;
}
select {
  border: 1px solid var(--line);
  padding: 10px;
  background: white;
  color: var(--ink);
  max-width: 60%;
}
#lets-play {
  width: 100%;
}
#celebration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}
.points-flight,
.solve-spark {
  position: absolute;
  color: #7247a1;
  font-weight: 800;
  font-size: 23px;
}
@media (max-width: 480px) {
  .masthead {
    padding: 12px 16px;
  }
  .brand {
    font-size: 31px;
    gap: 4px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
  }
  .header-actions {
    gap: 10px;
  }
  .total strong {
    font-size: 22px;
  }
  main {
    padding: 24px 16px 28px;
  }
  h1 {
    font-size: 26px;
    margin-bottom: 18px;
  }
  .word-collection {
    gap: 5px;
  }
  .word-collection li {
    min-height: 46px;
    font-size: 12px;
    border-radius: 10px;
  }
  .connection-panel {
    margin-bottom: 20px;
  }
  .play-area {
    padding: 22px 18px;
    border-radius: 18px;
  }
  #clue {
    font-size: 24px;
    margin-bottom: 20px;
  }
  .hint {
    gap: 10px;
    padding: 12px;
  }
  .hint p {
    font-size: 14px;
  }
  .hint.latest p {
    font-size: 18px;
  }
  .primary {
    padding: 12px 14px;
    font-size: 14px;
  }
  .clue-list-heading {
    font-size: 11px;
  }
  .reveal {
    padding: 12px;
  }
  #award {
    font-size: 18px;
  }
  .solve-badge {
    font-size: 11px;
  }
}
@media (max-width: 350px) {
  .masthead {
    padding-inline: 12px;
  }
  .brand {
    font-size: 30px;
  }
  .brand-mark {
    width: 27px;
    height: 27px;
  }
  .header-actions {
    gap: 7px;
  }
  .total {
    padding-inline: 8px;
  }
  .total strong {
    font-size: 20px;
  }
  main {
    padding-inline: 12px;
  }
  .play-area {
    padding-inline: 14px;
  }
  h1 {
    font-size: 24px;
  }
  .word-collection li {
    font-size: 11px;
  }
  .answer-controls {
    gap: 6px;
  }
  .primary {
    padding-inline: 12px;
  }
  .answer-controls .primary span {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

#connection-prize {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
#win-breakdown {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  text-align: left;
  border-block: 1px solid var(--line);
  margin: 0 0 18px;
  padding: 16px 0;
  font-size: 13px;
}
#win-breakdown dt {
  color: var(--muted);
}
#win-breakdown dd {
  margin: 0;
  font-weight: 650;
}
#summary {
  scroll-margin-top: 100px;
}
