:root {
  --page-bg: #ebe2d1;
  --panel: rgba(248, 242, 229, 0.96);
  --panel-border: #d8c6a5;
  --text-main: #2e261a;
  --text-soft: #665845;
  --accent: #425b46;
  --accent-soft: #d9e9d6;
  --board-frame: #5a4c36;
  --board-cell: #faf4e8;
  --board-trace: #d9e9d6;
  --board-found: #dbca9e;
  --shadow: 0 16px 40px rgba(30, 28, 22, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-main);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
}

a { color: var(--accent); }

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.breadcrumb {
  margin: 0 0 16px;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.hero,
.daily-game,
.help-panel,
.related-panel,
.faq-panel,
.board-panel,
.words-panel {
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel);
}

.hero,
.daily-game,
.help-panel,
.related-panel,
.faq-panel {
  margin-bottom: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.16;
}

h1 {
  margin: 0 0 10px;
  font-size: 3.25rem;
}

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

.lead,
.small-note,
.help-panel p,
.faq-grid p {
  margin: 0;
  color: var(--text-soft);
}

.status-bar {
  display: grid;
  grid-template-columns: 1.35fr 1.25fr repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.status-bar div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f3ecdd;
  text-align: center;
}

.status-bar span {
  display: block;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-bar strong {
  display: block;
  min-height: 1.5em;
  overflow-wrap: anywhere;
}

.tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fffdf6;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.button.secondary,
.button.quiet {
  background: #fffdf6;
  color: var(--accent);
}

.button.quiet { border-color: var(--panel-border); color: var(--text-soft); }
.button.is-active { background: var(--accent-soft); }

.button:focus-visible,
.word-cell:focus-visible {
  outline: 3px solid rgba(66, 91, 70, 0.26);
  outline-offset: 2px;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 285px;
  gap: 18px;
  align-items: start;
}

.board-panel,
.words-panel { padding: 16px; }

.word-grid {
  display: grid;
  gap: 2px;
  width: min(660px, 100%);
  margin: 0 auto;
  padding: 4px;
  border-radius: 12px;
  background: var(--board-frame);
  touch-action: none;
}

.word-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0;
  aspect-ratio: 1;
  border: 0;
  border-radius: 5px;
  background: var(--board-cell);
  color: #294333;
  cursor: pointer;
  font: 700 1.2rem Georgia, "Times New Roman", serif;
  line-height: 1;
  user-select: none;
  touch-action: none;
}

.word-cell.anchor { background: #efdba4; }
.word-cell.trace { background: var(--board-trace); }
.word-cell.found { background: var(--board-found); }

.word-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.word-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid #e2d5b7;
  border-radius: 8px;
  background: #fffaf0;
}

.word-list li.found {
  border-color: #bbcfb8;
  background: #e7f0e5;
  color: var(--text-soft);
}

.word-list li.found span { text-decoration: line-through; }

.word-found-label {
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.small-note { margin-top: 14px; font-size: 0.94rem; }

.win-panel[hidden] { display: none; }

.win-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #c9dbc7;
  border-radius: 12px;
  background: #eef4ee;
  text-align: center;
}

.win-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

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

.related-grid a,
.faq-grid article {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f3ecdd;
}

.related-grid a {
  color: inherit;
  text-decoration: none;
}

.related-grid strong {
  display: block;
  margin-bottom: 5px;
}

.related-grid span { color: var(--text-soft); }
.game-error { grid-column: 1 / -1; padding: 18px; color: var(--text-soft); }

@media (max-width: 780px) {
  .page-shell { width: min(100% - 18px, 1120px); padding: 14px 0 28px; }
  .hero, .daily-game, .help-panel, .related-panel, .faq-panel { padding: 16px; border-radius: 14px; }
  .status-bar, .game-layout, .related-grid, .faq-grid { grid-template-columns: 1fr; }
  .tools { flex-direction: column; }
  .board-panel, .words-panel { padding: 10px; border-radius: 12px; }
  .word-grid { gap: 1px; padding: 2px; }
  h1 { font-size: 2.1rem; }
  .word-cell { font-size: 0.82rem; }
  .win-links { flex-direction: column; }
}
