:root {
  --paper: #faf7f3;
  --panel: #fdfbf9;
  --tile: #f7f3f0;
  --key: #ebe7e3;
  --ink: #1c1c1c;
  --correct: #80a5c7;
  --present: #c53240;
  --absent: #262626;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Inter", Arial, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--present); outline-offset: 3px; }
.app { width: min(100%, 402px); margin: auto; padding: 25px 21px 12px; }
header { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; height: 40px; }
header h1 { grid-column: 2; grid-row: 1; margin: 0; text-align: center; font: 500 36px/40px "Source Serif 4", Georgia, serif; letter-spacing: 1.8px; }
header #menu { grid-column: 3; grid-row: 1; justify-self: end; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 8px; border: 0; background: transparent; }
.header-icon { display: block; width: 24px; height: 24px; }
.accent { width: 48px; height: 1px; margin: 14px auto 8px; background: #b5222b; }
.subtitle { margin: 0; text-align: center; font-size: 12px; line-height: 30px; letter-spacing: .6px; text-transform: uppercase; }
.count { margin: 0; text-align: center; font-size: 10px; line-height: 30px; color: #666; }
.board { display: grid; grid-template-columns: repeat(5, 48.1px); grid-auto-rows: 48.1px; gap: 6.9px; width: max-content; margin: 10px auto 20px; }
.tile { display: grid; place-items: center; min-width: 0; background: var(--tile); border: .5px solid #26262680; border-radius: 10px; font: 500 27px "Source Serif 4", Georgia, serif; }
.tile.active { border: 1px solid #262626; }
.keyboard-panel { width: 100%; padding: 12px 11px; background: var(--panel); border-radius: 10px; box-shadow: 0 0 4px #0000001a; }
.keyboard { display: grid; gap: 7.5px; width: 100%; }
.keyrow { display: flex; justify-content: center; gap: 3.55px; }
.key { display: flex; align-items: center; justify-content: center; flex: 1; min-width: 0; height: 38.5px; padding: 0; background: var(--key); border: 0; border-radius: 3px; box-shadow: 0 1px 0 #0000004d; font: 400 16px "Source Serif 4", Georgia, serif; }
.key.alphabet-toggle, .key.backspace { flex: 1.53; }
.key.alphabet-toggle img { display: block; width: 20px; height: 20px; }
.key.backspace { font-family: Arial, sans-serif; font-size: 20px; }
/* Preserve the original JavaScript's scoring classes on tiles and keys. */
.tile.correct, .key.correct { background: var(--correct); color: #fff; border-color: var(--correct); }
.tile.present, .key.present { background: var(--present); color: #fff; border-color: var(--present); }
.tile.absent, .key.absent { background: var(--absent); color: #fff; border-color: var(--absent); }
.submit-guess { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 40px; margin-top: 8px; padding: 8px 12px; background: var(--ink); color: var(--paper); border: 0; border-radius: 3px; box-shadow: 0 1px 0 #0000004d; font-size: 12px; line-height: 20px; letter-spacing: .6px; }
.submit-guess img { display: block; width: 20px; height: 20px; filter: brightness(0) invert(1); }
.key:not(:disabled):active, .submit-guess:not(:disabled):active { transform: translateY(1px); box-shadow: none; }
.key:disabled { cursor: default; }
.submit-guess:disabled { opacity: .5; cursor: default; }

.hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 16px;
  color: rgb(28 28 28 / 70%);
  font: 400 10px/20px "Inter", Arial, sans-serif;
}

.hint::before,
.hint::after {
  content: "";
  flex: 1;
  min-width: 0;
  height: 1px;
  background: #ccc;
}

.hint img {
  display: block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.hint span {
  text-align: center;
}

.banner { height: 93px; margin-bottom: 26px; display: grid; place-items: center; border: 1px dashed #d8cfc4; border-radius: 6px; color: #756b60; font-size: 11px; text-align: center; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 6px 0;
  border-top: 1px solid #ccc;
}

.footer-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 6px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.footer button img {
  display: block;
  width: 20px;
  height: 20px;
}

.footer button:focus-visible {
  outline: 2px solid #be2835;
  outline-offset: 2px;
}

.asset-slot { display: block; width: 16px; height: 16px; border: 1px dashed #bbb; border-radius: 3px; }
dialog { width: min(340px, calc(100% - 32px)); padding: 24px; background: var(--paper); color: var(--ink); border: 1px solid #ccc; border-radius: 12px; }
dialog::backdrop { background: #0005; }
dialog h2 { margin-top: 0; font-family: "Source Serif 4", Georgia, serif; }
dialog p { font-size: 14px; line-height: 1.6; }
.close { padding: 10px 20px; background: var(--ink); color: #fff; border: 0; border-radius: 5px; }
.status { position: fixed; bottom: 20px; left: 50%; z-index: 10; width: max-content; max-width: calc(100% - 32px); padding: 10px 18px; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 6px; font-size: 12px; text-align: center; }
.status:empty { display: none; }
@media (max-width: 380px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .keyboard-panel { padding: 10px 8px; }
  .keyrow { gap: 3px; }
  .key { font-size: 14px; }
}
@media (max-width: 300px) {
  .board { width: 100%; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: auto; gap: 5px; }
  .tile { aspect-ratio: 1; }
}

.key.backspace img {
  display: block;
  width: 22px;
  height: 22px;
}