:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1b;
  --color-border: #d3d6da;
  --color-correct: #6aaa64;
  --color-present: #c9b458;
  --color-absent: #787c7f;
  --tile-size: 3.2rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.header {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0;
}

.icon-button {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
}

.subtitle {
  font-size: 0.9rem;
  color: #565758;
  text-align: center;
  margin: 0;
}

.game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem;
  width: 100%;
  max-width: 500px;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.board-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.tile {
  width: var(--tile-size);
  height: var(--tile-size);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tile[data-state="tbd"] {
  border-color: #878a8c;
}

.tile[data-state="correct"] {
  background: var(--color-correct);
  border-color: var(--color-correct);
  color: #fff;
}

.tile[data-state="present"] {
  background: var(--color-present);
  border-color: var(--color-present);
  color: #fff;
}

.tile[data-state="absent"] {
  background: var(--color-absent);
  border-color: var(--color-absent);
  color: #fff;
}

.tile[data-state="absent"] .tile-letter {
  filter: blur(5px);
  user-select: none;
}

.toast {
  background: var(--color-text);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.keyboard-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.key {
  flex: 1;
  max-width: 43px;
  height: 58px;
  border: none;
  border-radius: 4px;
  background: #d3d6da;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.key-wide {
  max-width: 65px;
  font-size: 0.75rem;
}

.key[data-state="correct"] { background: var(--color-correct); color: #fff; }
.key[data-state="present"] { background: var(--color-present); color: #fff; }
/* Absent (wrong) keys intentionally keep the default key color — graying
   them out would reveal which letters are wrong, defeating the game's
   whole premise of hiding that information. */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 90vw;
  width: 320px;
  position: relative;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.stats-grid {
  display: flex;
  justify-content: space-around;
  margin: 1rem 0;
}

.stats-grid div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stats-grid strong {
  font-size: 1.5rem;
}

.share-preview {
  white-space: pre;
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 1rem 0;
}

.button {
  background: var(--color-correct);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}
