:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --text: #1d2525;
  --muted: #66716f;
  --line: #d8d4c8;
  --panel: #fffdf8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warm: #e86d2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1 {
  margin: 0 0 6px;
  font-size: 38px;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 14px;
}

.category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
}

button.active,
.guess-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

button:hover {
  border-color: var(--accent-strong);
}

.guess-form {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: white;
}

.message {
  min-height: 28px;
  color: var(--muted);
}

.message-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.text-button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  white-space: nowrap;
}

.stats {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 10px;
}

.attempts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.attempt {
  display: grid;
  grid-template-columns: 110px 1fr 72px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: #e8e4d8;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: var(--score);
  background: linear-gradient(90deg, var(--accent), var(--warm));
}

.score {
  text-align: right;
  font-weight: 700;
}

@media (max-width: 560px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .attempt {
    grid-template-columns: 86px 1fr 58px;
  }
}
