:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f7f4;
  color: #161616;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 32px;
}

main {
  width: min(100%, 1120px);
  margin: 0 auto;
}

header {
  max-width: 920px;
  margin: 0 auto 28px;
  text-align: center;
}

.home-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #3a5f7d;
  font-weight: 700;
  text-decoration: none;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(1.45rem, 3vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
}

.challenge-address {
  display: flex;
  width: max-content;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  margin: 0 auto 20px;
  border: 1px solid #d9ddd7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgb(30 37 47 / 8%);
  padding: 14px;
}

.rules-link {
  display: block;
  width: fit-content;
  margin: -4px auto 18px;
  color: #2b668d;
  font-weight: 850;
  text-decoration: none;
}

.rules-link:hover,
.rules-link:focus {
  text-decoration: underline;
}

.challenge-address img {
  display: block;
  width: min(260px, calc(100vw - 96px));
  height: auto;
}

.challenge-address figcaption {
  margin-top: 12px;
  text-align: center;
  width: 100%;
}

.challenge-address a {
  color: #2b668d;
  font-weight: 800;
  text-decoration: none;
}

.challenge-address a:hover,
.challenge-address a:focus {
  text-decoration: underline;
}

p {
  margin: 0;
  color: #4f555b;
  font-size: 1.05rem;
  line-height: 1.65;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

form,
.result {
  border: 1px solid #d9ddd7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgb(30 37 47 / 8%);
}

form {
  padding: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid #d9ddd7;
  border-radius: 8px;
}

legend {
  padding: 0 6px;
  font-weight: 800;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: #3b4147;
  font-weight: 650;
}

input {
  width: 100%;
  border: 1px solid #b9c1c7;
  border-radius: 6px;
  padding: 12px 13px;
  color: #171a1d;
  font: inherit;
}

input:focus {
  border-color: #2d6cdf;
  outline: 3px solid rgb(45 108 223 / 18%);
}

input.invalid {
  border-color: #b42318;
  background: #fff7f6;
}

.hint {
  margin-top: 16px;
  font-size: 0.95rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}

button {
  border: 0;
  border-radius: 6px;
  background: #18864b;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 12px 18px;
}

button:disabled {
  background: #8ca99a;
  cursor: not-allowed;
}

#lock-message {
  color: #5f6770;
}

.result {
  margin-top: 24px;
  padding: 24px;
}

.status {
  margin-bottom: 22px;
  border-radius: 6px;
  padding: 14px 16px;
  font-weight: 900;
}

.status.incorrect {
  background: #ffe7e3;
  color: #b42318;
}

.status.claim {
  background: #e2f7e8;
  color: #146c2e;
}

dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

dt {
  color: #5d6570;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  min-width: 0;
  margin: 0 0 10px;
}

dd code {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid #d9ddd7;
  border-radius: 6px;
  background: #f7f8f7;
  padding: 12px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    padding: 20px;
  }

  h1 {
    font-size: clamp(1.05rem, 4.5vw, 1.35rem);
  }

  form,
  .result {
    padding: 18px;
  }

  .challenge-address img {
    width: min(260px, calc(100vw - 68px));
  }

  .grid {
    grid-template-columns: 1fr;
  }
}
