:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: #203238;
  background: #f2f3ed;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 6% 4%, #dcefe8 0, transparent 31%),
    radial-gradient(circle at 94% 82%, #f8e4d1 0, transparent 26%), #f2f3ed;
}

button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 0 42px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: #fff;
  background: #1d514b;
  font-weight: 800;
  letter-spacing: -0.05em;
  box-shadow: 0 8px 16px #1d514b22;
}
.brand-name {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.header-note {
  color: #697f7a;
  font-size: 0.84rem;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  align-items: start;
  gap: 24px;
}
.panel {
  border: 1px solid #e3e9e2;
  border-radius: 24px;
  background: #fffefa;
  box-shadow: 0 16px 45px #24443b0b;
}
.game-panel {
  padding: clamp(26px, 4vw, 50px);
}
.records-panel {
  padding: 32px;
}
.eyebrow {
  margin: 0 0 18px;
  color: #dc6846;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.17em;
}
.main-title {
  max-width: 600px;
  margin: 0;
  color: #183b38;
  font-size: clamp(2.3rem, 4.8vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: -0.055em;
}
.description {
  max-width: 540px;
  margin: 20px 0 36px;
  color: #607571;
  font-size: 1.02rem;
  line-height: 1.7;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.field-label {
  color: #3c5853;
  font-size: 0.81rem;
  font-weight: 700;
}
.select,
.guess-input {
  width: 100%;
  min-height: 54px;
  border: 1px solid #d8e2db;
  border-radius: 12px;
  color: #24443f;
  background: #fff;
  outline: none;
  padding: 0 15px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.select:focus-visible,
.guess-input:focus-visible,
.button:focus-visible {
  border-color: #277b6e;
  box-shadow: 0 0 0 4px #277b6e28;
  outline: none;
}
.select:disabled {
  color: #637671;
  background: #f4f6f1;
  cursor: not-allowed;
}
.hint-card,
.win-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 26px 0;
  padding: 17px 19px;
  border-radius: 14px;
  background: #eaf5ee;
  color: #375c52;
}
.hint-card p,
.win-card p {
  margin: 0;
  font-size: 0.89rem;
  line-height: 1.55;
}
.hint-icon,
.win-icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: #408c77;
  font-size: 0.8rem;
  font-weight: 700;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 23px;
  font-weight: 750;
  transition:
    transform 0.15s,
    background 0.15s;
}
.button:hover {
  transform: translateY(-2px);
}
.button-primary {
  color: #fff;
  background: #19574e;
}
.button-primary:hover {
  background: #10483f;
}
.button-secondary {
  color: #28564f;
  background: #eef5ef;
}
.button-secondary:hover {
  background: #e0eee4;
}
.records-title {
  margin: 0 0 10px;
  color: #183b38;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}
.records-description {
  margin: 0 0 26px;
  color: #73837d;
  font-size: 0.88rem;
  line-height: 1.6;
}
.empty-records,
.empty-state {
  margin: 0;
  border: 1px dashed #d7e1d9;
  border-radius: 13px;
  padding: 22px;
  color: #8a9a93;
  font-size: 0.87rem;
  line-height: 1.6;
}
.records-list,
.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.record-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  border-top: 1px solid #edf0e9;
}
.record-rank {
  color: #da7856;
  font-size: 0.8rem;
  font-weight: 800;
}
.record-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.record-meta strong {
  color: #24443f;
  font-size: 0.88rem;
}
.record-meta span {
  color: #8b9990;
  font-size: 0.72rem;
}
.record-time {
  margin-left: auto;
  color: #52756c;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}
.status-bar {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 24px 0;
  padding: 15px 18px;
  border: 1px solid #e1e8df;
  border-radius: 13px;
  color: #6a7b73;
  background: #f7f8f3;
  font-size: 0.82rem;
}
.timer {
  color: #214b42;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.1rem;
}
.status-attempts {
  margin-left: auto;
}
.guess-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}
.guess-form .button {
  white-space: nowrap;
}
.guess-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.guess-input::placeholder {
  color: #c4d2c9;
}
.feedback {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 1.2em;
  color: #9b7466;
  font-size: 0.78rem;
}
.history-section {
  margin: 33px 0 28px;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}
.section-heading h2 {
  margin: 0;
  color: #24443f;
  font-size: 1.1rem;
}
.count-badge {
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  border-radius: 50%;
  color: #3b705f;
  background: #e8f2ea;
  font-size: 0.75rem;
  font-weight: 800;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 3px;
  border-bottom: 1px solid #edf0e9;
}
.row-number {
  color: #98a9a0;
  font-size: 0.75rem;
  font-weight: 700;
}
.guess-code {
  margin-right: auto;
  color: #24443f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.06rem;
  letter-spacing: 0.14em;
}
.result-pill {
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}
.bulls {
  color: #27725c;
  background: #e4f2e9;
}
.cows {
  color: #a5684a;
  background: #fbefe2;
}
.win-card {
  background: #e4f3e9;
}
.site-footer {
  padding: 30px 0 40px;
  color: #91a099;
  font-size: 0.78rem;
  text-align: center;
}

@media (max-width: 850px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .records-panel {
    order: 2;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 28px, 420px);
  }
  .site-header {
    padding: 20px 0 25px;
  }
  .header-note {
    display: none;
  }
  .brand-name {
    font-size: 0.7rem;
  }
  .game-panel,
  .records-panel {
    padding: 23px;
    border-radius: 18px;
  }
  .description {
    margin-bottom: 26px;
  }
  .settings-grid,
  .guess-form {
    grid-template-columns: 1fr;
  }
  .guess-form .button {
    width: 100%;
  }
  .feedback {
    grid-column: auto;
  }
  .status-bar {
    flex-wrap: wrap;
  }
  .status-attempts {
    width: 100%;
    margin-left: 0;
  }
  .history-row {
    gap: 7px;
  }
  .result-pill {
    font-size: 0.65rem;
  }
}
