* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "nyt-cheltenham", "Georgia", serif;
  background: #faf8f5;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: 100%;
  max-width: 600px;
  padding: 24px 16px 8px;
  text-align: center;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

#datePicker {
  font-family: inherit;
  font-size: 1rem;
  color: #555;
  background: white;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

#datePicker:focus {
  outline: none;
  border-color: #5ba4cf;
}

.loading {
  display: block;
  padding: 60px 20px;
  text-align: center;
  font-size: 1.1rem;
  color: #888;
  font-style: italic;
}

.game-area {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 32px;
  width: 100%;
  max-width: 600px;
}

.puzzle-date {
  text-align: center;
  font-size: 0.95rem;
  color: #666;
  margin: 8px 0 4px;
}

.hive {
  --hex-size: 96px;
  /* Flat-top hex grid: center-to-center spacing for touching cells */
  --hex-x: calc(var(--hex-size) * 0.866025);
  --hex-y: calc(var(--hex-size) * 0.75);
  --hex-dy: calc(var(--hex-size) * 0.375);
  position: relative;
  width: calc(var(--hex-x) * 2 + var(--hex-size));
  height: calc(var(--hex-y) * 2 + var(--hex-size));
  margin: 16px auto 12px;
}

.hive-letter {
  position: absolute;
  width: var(--hex-size);
  height: var(--hex-size);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Inter", "Arial Black", sans-serif;
  font-weight: 900;
  font-size: 2.4rem;
  color: #1a1a1a;
  text-transform: uppercase;
  background: #e0e0e0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transform: translate(-50%, -50%);
}

.hive-letter.center {
  left: 50%;
  top: 50%;
  background: #f7da21;
  z-index: 2;
}

.hive-letter.pos-0 {
  left: 50%;
  top: calc(50% - var(--hex-y));
}

.hive-letter.pos-1 {
  left: calc(50% + var(--hex-x));
  top: calc(50% - var(--hex-dy));
}

.hive-letter.pos-2 {
  left: calc(50% + var(--hex-x));
  top: calc(50% + var(--hex-dy));
}

.hive-letter.pos-3 {
  left: 50%;
  top: calc(50% + var(--hex-y));
}

.hive-letter.pos-4 {
  left: calc(50% - var(--hex-x));
  top: calc(50% + var(--hex-dy));
}

.hive-letter.pos-5 {
  left: calc(50% - var(--hex-x));
  top: calc(50% - var(--hex-dy));
}

.progress-stats {
  text-align: center;
  margin: 8px 0 4px;
}

.progress-stats .progress {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.progress-stats .progress + .progress {
  margin-top: 8px;
}

.progress {
  text-align: center;
  font-size: 0.95rem;
  color: #555;
}

.stat-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #f7da21;
  font-family: "Inter", "Arial Black", sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  color: #1a1a1a;
  border-radius: 2px;
  flex-shrink: 0;
}

.reveal-toolbar {
  display: flex;
  gap: 8px;
  margin: 16px 0 6px;
  width: 100%;
  max-width: 380px;
}

.reveal-toolbar .btn {
  flex: 1;
}

.reveal-hint {
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #1a1a1a;
  color: white;
}

.btn-primary:hover {
  background: #333;
}

.btn-primary:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.btn-secondary {
  background: #e8e8e8;
  color: #333;
}

.btn-secondary:hover {
  background: #ddd;
}

.answers-section {
  width: 100%;
  max-width: 520px;
}

.answers-heading {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 10px;
  text-align: center;
}

.answers-toolbar {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.answers-toolbar .btn {
  min-width: 180px;
}

.word-list {
  border: 1px solid #e6e2dc;
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.word-list-select-all {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  user-select: none;
}

.word-list-select-all:hover {
  background: #faf8f5;
}

.word-list-select-all input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.word-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  overflow: hidden;
  max-height: 60px;
  transition:
    transform 0.28s ease,
    opacity 0.28s ease,
    max-height 0.28s ease,
    padding 0.28s ease;
}

.word-row:hover {
  background: #faf8f5;
}

.word-row.dismissing {
  transform: translateY(-120%);
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

#wordList .word-row:last-child {
  border-bottom: none;
}

.word-row-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.word-row-tiles {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.word-row-dismiss {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #aaa;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  border-radius: 4px;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.word-row:hover .word-row-dismiss {
  opacity: 1;
}

.word-row-dismiss:hover {
  color: #333;
  background: #e8e8e8;
}

.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary:disabled:hover {
  background: #e8e8e8;
}

.letter-tile {
  width: 24px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7da21;
  font-family: "Inter", "Arial Black", sans-serif;
  font-weight: 900;
  font-size: 0.85rem;
  color: #1a1a1a;
  text-transform: uppercase;
  border-radius: 2px;
  flex-shrink: 0;
}

.letter-tile.hidden-letter {
  color: #1a1a1a;
}

.site-footer {
  width: 100%;
  max-width: 600px;
  padding: 20px 16px 28px;
  margin-top: auto;
  text-align: center;
}

.site-footer p {
  font-size: 0.72rem;
  color: #999;
  line-height: 1.5;
}

.site-footer em {
  font-style: normal;
  color: #888;
}

@media (max-width: 420px) {
  header h1 {
    font-size: 1.6rem;
  }

  .letter-tile {
    width: 24px;
    height: 30px;
    font-size: 0.85rem;
  }

  .hive {
    --hex-size: 72px;
  }

  .hive-letter {
    font-size: 1.8rem;
  }

  .stat-tile {
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
  }
}
