* {
  box-sizing: border-box;
}

:root {
  --bg: #08111f;
  --header: #111d31;
  --card: #17263b;
  --input: #0d1929;
  --border: #304863;
  --text: #f5f7fb;
  --muted: #aebdcb;
  --gold: #f3c45d;
  --gold-light: #fff0ae;
  --blue: #3e8ec5;
  --blue-dark: #24658f;
  --green: #3aa66d;
  --green-dark: #26764c;
  --red: #c65d62;
  --yellow: #f1b84d;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.header {
  min-height: 108px;
  background: var(--header);
  text-align: center;
  padding: 14px 90px 12px;
  position: relative;
  border-bottom: 1px solid #20334b;
}

.header h1 {
  margin: 0;
  color: var(--gold);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 3px 3px 0 #6a4105, 0 -1px 0 var(--gold-light);
}

.header p {
  margin: 5px 0 0;
  color: #d8e4ef;
  font-size: 14px;
  font-weight: 700;
}

button, select, input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hint-btn {
  position: absolute;
  top: 19px;
  right: 22px;
  padding: 9px 14px;
  color: #142033;
  background: #6d4d17;
  border: 3px solid #3f2d0c;
  border-radius: 5px;
}

.hint-btn:not(:disabled):hover {
  background: #987126;
}

.main {
  width: min(1100px, calc(100% - 40px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  min-height: 500px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
}

.controls-card {
  padding: 22px 28px;
}

.card h2 {
  margin: 0 0 20px;
  text-align: center;
  font-size: 16px;
  letter-spacing: .5px;
  text-shadow: 2px 2px 0 #080d16;
}

.controls-card label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin: 10px 0 5px;
  letter-spacing: .5px;
}

select,
input {
  width: 100%;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  outline: none;
}

select {
  padding: 11px;
  font-weight: 700;
}

input {
  padding: 10px;
  font-size: 19px;
  font-weight: 700;
  text-align: center;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(62,142,197,.18);
}

.start-btn,
.check-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border-radius: 5px;
  border: 3px solid rgba(0,0,0,.28);
  color: #142033;
}

.start-btn {
  background: var(--green);
}

.start-btn:hover {
  background: var(--green-dark);
}

.check-btn {
  background: var(--blue);
  margin-top: 8px;
}

.check-btn:hover:not(:disabled) {
  background: var(--blue-dark);
}

.status {
  min-height: 70px;
  margin: 0 0 10px;
  padding: 14px 8px;
  background: var(--input);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 2px 2px 0 #05080d;
}

.attempts {
  text-align: center;
  color: var(--yellow);
  font-size: 14px;
  font-weight: 800;
  margin: 7px 0;
}

.best-score {
  text-align: center;
  color: #7ce6aa;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
}

.history-card {
  padding: 18px 24px 24px;
  min-width: 0;
}

.history-card h2 {
  text-align: left;
  margin-bottom: 9px;
  font-size: 17px;
}

.history {
  height: calc(100% - 48px);
  min-height: 400px;
  overflow-y: auto;
  background: var(--input);
  padding: 8px;
  border-radius: 2px;
}

.history-item {
  padding: 11px 12px;
  border-bottom: 1px solid #22364e;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.history-item.correct {
  color: #7ce6aa;
}

.history-item.higher,
.history-item.lower {
  color: var(--yellow);
}

.history-item.gameover {
  color: #ff9aa1;
}

footer {
  text-align: center;
  padding: 0 0 20px;
}

footer button {
  padding: 9px 22px;
  margin: 0 5px;
  border-radius: 4px;
  border: 2px solid rgba(0,0,0,.25);
  color: #142033;
}

.new-game-btn {
  background: #263e58;
}

.new-game-btn:hover {
  background: #365875;
}

.quit-btn {
  background: #512f3a;
}

.quit-btn:hover {
  background: var(--red);
}

@media (max-width: 800px) {
  .header {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hint-btn {
    position: static;
    margin-top: 12px;
  }

  .main {
    grid-template-columns: 1fr;
    width: min(94%, 600px);
  }

  .history {
    min-height: 300px;
    height: 300px;
  }
}
