:root {
  --blue: #0878df;
  --blue-dark: #045cae;
  --text: #111827;
  --muted: #667085;
  --line: #d9e2ec;
  --bg: #f7fbff;
  --error: #c62828;
  --success: #147d3f;
  --warn: #9a6500;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.card,
.recent {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}

.faucet-img {
  display: block;
  width: min(260px, 82%);
  margin: 0 auto 14px;
}

h1 {
  margin: 0 0 8px;
  font-size: 38px;
  line-height: 1;
  text-align: center;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.lede {
  margin: 0 0 20px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.ca-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.ca-row code {
  max-width: 240px;
  overflow: hidden;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#copy-ca {
  padding: 5px 8px;
  color: var(--blue);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

#copy-ca:hover {
  background: #eef6ff;
}

.community-link {
  display: block;
  width: fit-content;
  margin: -8px auto 18px;
  color: var(--blue);
  font-size: 14px;
  text-decoration: none;
}

.community-link:hover {
  text-decoration: underline;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.status-row div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.status-row span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.status-row strong {
  display: block;
  font-size: 14px;
}

form {
  display: grid;
  gap: 10px;
}

label {
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--blue);
}

.challenge {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f9fbfd;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  color: #fff;
  background: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--blue-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

#refresh-challenge {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: var(--blue);
  background: transparent;
  border: 1px solid var(--line);
}

#refresh-challenge:hover {
  background: #eef6ff;
}

.message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.message.success {
  color: var(--success);
}

.message.error {
  color: var(--error);
}

.message.warn {
  color: var(--warn);
}

.recent {
  margin-top: 14px;
}

.recent-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.recent-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

@media (max-width: 520px) {
  .status-row {
    grid-template-columns: 1fr;
  }

  .challenge {
    align-items: stretch;
    flex-direction: column;
  }
}
