:root {
  --paper: #f8faff;
  --ink: #252d48;
  --muted: #737d94;
  --blue: #3948ad;
  --line: #dce2ee;
  --correct: #3948ad;
  --present: #f0ce72;
  --absent: #626d85;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font:
    14px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #bc861f;
  outline-offset: 4px;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 80px, 1120px);
  height: 88px;
  margin: 0 auto;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  font-weight: 730;
  letter-spacing: -0.7px;
}
.brand-light {
  font-weight: 450;
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 9px);
  gap: 3px;
  transform: rotate(-7deg);
}
.brand-mark i {
  width: 9px;
  height: 9px;
  background: var(--blue);
  border-radius: 2px;
}
.brand-mark i:nth-child(2) {
  background: var(--present);
}
.icon-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  color: #596780;
  background: transparent;
  font-weight: 600;
  font-size: 16px;
}
.icon-button:hover,
.new-game:hover {
  background: #eaf0fb;
  border-color: #bcc7df;
}
.layout {
  width: 100%;
  flex: 1;
  padding: 24px 20px 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game {
  width: 100%;
  max-width: 480px;
}
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 29px;
}
h1 {
  margin: 0 0 3px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 730;
  letter-spacing: -1.1px;
}
#attempt {
  color: var(--muted);
  font-size: 12px;
}
.new-game {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
}
.new-game svg {
  width: 16px;
  height: 16px;
}
.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  width: 300px;
  margin: 0 auto;
  outline: none;
}
.tile {
  display: grid;
  place-items: center;
  height: 55px;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 27px;
  line-height: 1;
  font-weight: 650;
}
.tile.current {
  border-color: #a6b0d1;
}
.tile.filled {
  border-color: #7485bb;
  background: #edf1fb;
}
.correct {
  background: var(--correct) !important;
  color: #fff !important;
  border-color: var(--correct) !important;
}
.present {
  background: var(--present) !important;
  color: #44350e !important;
  border-color: var(--present) !important;
}
.absent {
  background: var(--absent) !important;
  color: #fff !important;
  border-color: var(--absent) !important;
}
.message {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  margin: 17px 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.message.error {
  color: #a33144;
}
.message.finished {
  color: var(--blue);
  font-weight: 650;
}
.keyboard {
  display: grid;
  gap: 6px;
}
.key-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}
.key {
  min-width: 0;
  height: 44px;
  padding: 0;
  flex: 1;
  border: 0;
  border-radius: 6px;
  background: #e6ebf5;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}
.key:hover {
  filter: brightness(0.95);
}
.key.wide {
  flex: 1.65;
  font-size: 20px;
}
.key.submit {
  flex: 3.2;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
}
.key:disabled {
  cursor: default;
  opacity: 0.75;
}
.footer {
  width: min(100% - 80px, 1120px);
  margin: 0 auto;
  padding: 25px 0 29px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
}
.footer-brand {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.35px;
}
.footer-brand > span {
  font-weight: 450;
}
.footer-brand small {
  margin-left: 18px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
.footer nav {
  display: flex;
  gap: 26px;
}
.footer nav button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #59647b;
  font-size: 12px;
}
.footer nav button:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}
dialog {
  width: calc(100% - 32px);
  max-width: 420px;
  max-height: calc(100svh - 32px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 100px #1a295b26;
}
dialog::backdrop {
  background: #24315266;
  backdrop-filter: blur(3px);
}
dialog h2 {
  margin: 0 25px 19px 0;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.8px;
}
dialog p {
  color: #606b81;
  font-size: 13px;
  line-height: 1.65;
}
.dialog-close {
  position: absolute;
  top: 9px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
}
.rules-list {
  list-style: none;
  display: grid;
  gap: 15px;
  margin: 24px 0;
  padding: 0;
}
.rules-list li {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #606b81;
  font-size: 12px;
}
.rules-list strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.sample {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 650;
  flex-shrink: 0;
}
.primary {
  width: 100%;
  margin-top: 12px;
  padding: 11px 15px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}
@media (max-width: 600px) {
  .header {
    width: calc(100% - 40px);
    height: 70px;
  }
  .brand {
    font-size: 18px;
  }
  .layout {
    padding: 14px 16px 34px;
  }
  .game-top {
    margin-bottom: 24px;
  }
  h1 {
    font-size: 27px;
  }
  .board {
    width: 280px;
    gap: 6px;
  }
  .tile {
    height: 51px;
    font-size: 25px;
  }
  .key-row {
    gap: 4px;
  }
  .key {
    height: 44px;
    font-size: 12px;
  }
  .key.submit {
    font-size: 10px;
  }
  .footer {
    width: calc(100% - 40px);
    padding: 20px 0 23px;
  }
  .footer-brand {
    font-size: 13px;
  }
  .footer-brand small {
    display: block;
    margin: 3px 0 0;
    font-size: 10px;
  }
  .footer nav {
    gap: 20px;
  }
  .footer nav button {
    font-size: 11px;
  }
}
@media (max-width: 350px) {
  .header {
    height: 62px;
    width: calc(100% - 32px);
  }
  .layout {
    padding: 12px 10px 26px;
  }
  .game-top {
    margin-bottom: 20px;
  }
  h1 {
    font-size: 25px;
  }
  .board {
    width: 264px;
  }
  .tile {
    height: 47px;
  }
  .key-row {
    gap: 3px;
  }
  .key {
    font-size: 11px;
  }
  .key.submit {
    font-size: 9px;
  }
  .new-game {
    padding: 8px 9px;
    font-size: 11px;
  }
  .footer {
    width: calc(100% - 32px);
  }
  .footer nav {
    gap: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
