:root {
  color-scheme: light;
  color: #1a241f;
  background: #f1f4ee;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
  min-width: 0;
}

button {
  min-height: 44px;
  border: 1px solid #8f9b91;
  border-radius: 6px;
  padding: 0 16px;
  color: #17221c;
  background: #ffffff;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  border-color: #465b4d;
  outline: none;
}

.puzzle-shell {
  width: min(1120px, calc(100vw - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding: 30px 0 42px;
  overflow-x: hidden;
}

.puzzle-header {
  max-width: 100%;
  margin-bottom: 22px;
  overflow: hidden;
}

.home-link {
  color: #415b4a;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible {
  text-decoration: underline;
}

.eyebrow {
  margin: 26px 0 10px;
  color: #52675b;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  width: 100%;
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: normal;
}

.puzzle-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 100%;
  min-width: 0;
}

.result-panel,
.board-panel {
  min-width: 0;
  border: 1px solid #d1d9cf;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 42px rgb(27 39 31 / 0.08);
}

.result-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.date-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #52675b;
  font-size: 0.86rem;
  font-weight: 800;
}

input {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid #aeb9ad;
  border-radius: 6px;
  padding: 0 12px;
  color: #17221c;
  background: #ffffff;
}

input:focus {
  outline: 2px solid #54715e;
  outline-offset: 1px;
}

.date-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.date-labels div,
.date-summary-card {
  min-width: 0;
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d7dfd5;
  border-radius: 8px;
  background: #f8faf7;
}

.date-labels span,
.date-summary-card span {
  color: #607367;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.date-labels strong {
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.date-summary {
  margin: 0;
  color: #1a241f;
  font-size: clamp(1.25rem, 5.4vw, 1.75rem);
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.count-card {
  min-height: 170px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border-radius: 8px;
  color: #f7fbf8;
  background: #1f4f3a;
}

.count-card strong {
  font-size: clamp(4rem, 14vw, 8rem);
  line-height: 0.88;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.count-card span {
  color: #d9eadf;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
}

.board-panel {
  padding: 18px;
  overflow: hidden;
}

.puzzle-board {
  --board-gap: 4px;
  --board-cell: calc((100vw - 104px) * 0.142857);

  display: grid;
  grid-template-columns: repeat(7, var(--board-cell));
  justify-content: center;
  gap: var(--board-gap);
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.board-cell {
  min-width: 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #b8c6bb;
  border-radius: 6px;
  color: #28352d;
  background: #eef4ef;
  font-size: clamp(0.78rem, 2.2vw, 1.08rem);
  font-weight: 850;
  overflow: hidden;
  text-align: center;
}

.board-cell.blocked {
  color: transparent;
  background: #2e3631;
  border-color: #2e3631;
}

.board-cell.date-hole {
  color: #ffffff;
  background: #b85f32;
  border-color: #8f3d1c;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.62);
}

@media (max-width: 820px) {
  .puzzle-shell {
    width: min(100% - 24px, 640px);
    padding-top: 22px;
  }

  .puzzle-workspace {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.05rem, 10vw, 4rem);
  }
}

@media (min-width: 521px) {
  .puzzle-board {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .date-controls {
    grid-template-columns: 1fr;
  }

  .date-controls button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .date-labels {
    grid-template-columns: 1fr;
  }

  .date-labels div,
  .date-summary-card {
    min-height: 78px;
  }

  .board-panel {
    padding: 10px;
  }

  .puzzle-board {
    width: 100%;
  }

  .count-card {
    min-height: 140px;
    padding: 18px;
  }
}

@media (max-width: 380px) {
  .puzzle-shell {
    width: min(100% - 16px, 640px);
  }

  .result-panel {
    gap: 14px;
    padding: 14px;
  }

  .board-panel {
    padding: 8px;
  }

  .board-cell {
    border-radius: 4px;
    font-size: 0.72rem;
  }
}

@media (max-width: 340px) {
  h1 {
    font-size: 2rem;
  }

  .puzzle-board {
    --board-cell: calc((100vw - 88px) * 0.142857);
  }
}
