:root {
  --ink: #20211d;
  --muted: #686a61;
  --paper: #f8f4e8;
  --panel: #fffaf0;
  --line: #d7c9ad;
  --moss: #415346;
  --brick: #9a463a;
  --gold: #d8aa4d;
  --blue: #315d73;
  --shadow: 0 24px 70px rgba(32, 33, 29, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(49, 93, 115, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(65, 83, 70, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 38px 38px;
  font-family: Georgia, "Times New Roman", serif;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 48px);
  background: rgba(248, 244, 232, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

nav {
  display: flex;
  gap: 18px;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav a:hover {
  color: var(--ink);
}

main {
  min-height: 100vh;
}

.daily-shell {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(340px, 1.15fr) minmax(250px, 0.8fr);
  gap: 22px;
  align-items: stretch;
  min-height: calc(100vh - 72px);
  padding: clamp(18px, 4vw, 48px);
}

.case-panel,
.puzzle-panel,
.word-panel,
.signup-form,
.account-card {
  background: rgba(255, 250, 240, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.case-panel,
.puzzle-panel,
.word-panel {
  padding: clamp(18px, 2.6vw, 30px);
}

.case-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 6px solid var(--brick);
}

.eyebrow,
.toolbar-label {
  margin: 0 0 10px;
  color: var(--brick);
  font-family: Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 7ch;
  font-size: clamp(3rem, 6.8vw, 4.9rem);
  line-height: 0.92;
  letter-spacing: 0;
  overflow-wrap: normal;
}

h2 {
  margin: 0 0 14px;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.case-copy,
.section-copy p,
.reader-copy p,
.feature-grid p,
.report-box p,
.account-card p,
.form-note,
.status-line {
  color: var(--muted);
  line-height: 1.55;
}

.case-copy {
  max-width: 34rem;
  margin: 22px 0;
  font-size: 1.05rem;
}

.case-facts {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
}

.case-facts div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
}

dd {
  margin: 0;
  font-weight: 700;
}

.case-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 44px;
  border: 1px solid var(--ink);
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-weight: 700;
}

.primary-button {
  padding: 0 18px;
  color: #fffaf0;
  background: var(--ink);
}

.primary-button:hover {
  background: var(--moss);
}

.ghost-button {
  padding: 0 16px;
  color: var(--ink);
  background: transparent;
}

.icon-button {
  width: 44px;
  color: var(--ink);
  background: var(--gold);
  font-size: 1.3rem;
}

.status-line {
  min-height: 3.2em;
  margin: 18px 0 0;
  font-family: Arial, sans-serif;
  font-size: 0.92rem;
}

.puzzle-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.puzzle-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toolbar-value {
  margin: 0;
  font-family: Arial, sans-serif;
  font-weight: 700;
}

.streak-box {
  display: grid;
  place-items: center;
  width: 82px;
  min-height: 58px;
  color: #fffaf0;
  background: var(--blue);
}

.streak-box span {
  font-family: Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
}

.streak-box small {
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.grid-wrap {
  display: grid;
  place-items: center;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(22px, 1fr));
  width: min(100%, 620px);
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  background: #fffdf7;
}

.cell {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid rgba(32, 33, 29, 0.18);
  color: var(--ink);
  background: transparent;
  font-family: Arial, sans-serif;
  font-size: clamp(0.82rem, 2vw, 1.2rem);
  font-weight: 800;
  user-select: none;
}

.cell.selected {
  background: rgba(216, 170, 77, 0.52);
}

.cell.found {
  color: #fffaf0;
  background: var(--moss);
}

.cell.clue {
  color: #fffaf0;
  background: var(--brick);
}

.evidence-entry {
  display: grid;
  gap: 8px;
  font-family: Arial, sans-serif;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid var(--line);
}

input:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(49, 93, 115, 0.35);
  outline-offset: 2px;
}

.word-panel {
  display: grid;
  align-content: center;
  gap: 22px;
  border-right: 6px solid var(--blue);
}

.word-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.word-list li {
  min-height: 34px;
  padding: 8px 10px;
  background: rgba(65, 83, 70, 0.08);
  border-left: 4px solid transparent;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.word-list li.done {
  color: var(--moss);
  border-color: var(--moss);
  text-decoration: line-through;
}

.report-box {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

#reportBlank {
  color: var(--brick);
  font-weight: 800;
}

.product-band,
.reader-band {
  display: grid;
  gap: 28px;
  padding: clamp(42px, 7vw, 90px) clamp(18px, 6vw, 72px);
}

.product-band {
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  align-items: start;
  background: var(--ink);
  color: #fffaf0;
}

.product-band .eyebrow,
.product-band p {
  color: #e1d2b5;
}

.section-copy p,
.reader-copy p {
  max-width: 46rem;
  margin: 0;
}

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

.feature-grid article {
  min-height: 170px;
  padding: 22px;
  background: rgba(255, 250, 240, 0.08);
  border: 1px solid rgba(255, 250, 240, 0.22);
}

.reader-band {
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 0.7fr);
  align-items: center;
}

.signup-form,
.account-card {
  display: grid;
  gap: 14px;
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.form-note {
  min-height: 1.5em;
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
}

.account-dialog {
  width: min(92vw, 460px);
  padding: 0;
  border: 0;
  background: transparent;
}

.account-dialog::backdrop {
  background: rgba(32, 33, 29, 0.58);
}

.account-card {
  position: relative;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 1.4rem;
}

@media (max-width: 1060px) {
  .daily-shell {
    grid-template-columns: 1fr 1fr;
  }

  .case-panel {
    grid-column: 1 / -1;
  }

  h1 {
    max-width: 14ch;
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  nav {
    grid-column: 1 / -1;
    order: 3;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .daily-shell,
  .product-band,
  .reader-band {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .case-facts div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (max-width: 430px) {
  .word-list {
    grid-template-columns: 1fr;
  }

  .daily-shell {
    padding-inline: 12px;
  }

  .case-panel,
  .puzzle-panel,
  .word-panel {
    padding: 16px;
  }
}
