:root {
  --paper: #f6f1e7;
  --ink: #111;
  --muted: #49463e;
  font-family:
    "Libre Franklin",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  overscroll-behavior: none;
}
body {
  margin: 0;
  min-width: 280px;
  min-height: 100svh;
}
button,
a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.newspaper {
  max-width: 580px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    calc(20px + env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}
.masthead {
  margin: 0 4px;
}
.edition-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  border-bottom: 3px double var(--ink);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
#desk-label {
  font-size: 0.6rem;
  text-align: right;
}
#results-link {
  border: 0;
  background: none;
  padding: 0 0 0 10px;
  min-height: 44px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.masthead h1 {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 8.8vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
  text-align: center;
  margin: 16px 0 12px;
}
.edition-title {
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 3px double var(--ink);
  text-align: center;
  text-transform: uppercase;
  font-size: 0.63rem;
  letter-spacing: 0.09em;
  font-weight: 600;
}
.instructions {
  margin: 20px 4px 18px;
}
.instructions h2 {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 5px;
}
.instructions p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
#board {
  width: min(100%, 275px);
  margin: 0 auto;
  display: grid;
  gap: 5px;
  outline: none;
}
#board:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}
.row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}
.tile {
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  border: 1px solid #bcb5a8;
  background: #eee9df;
  font-size: clamp(1.25rem, 7vw, 1.6rem);
  line-height: 1;
  font-weight: 600;
  user-select: none;
}
.tile.filled {
  border-color: var(--ink);
}
.tile.green {
  background: #a0c35a;
  border-color: #1112;
}
.tile.yellow {
  background: #f9df6d;
  border-color: #1112;
}
.tile.grey {
  background: #5f625f;
  color: var(--paper);
  border-color: #1112;
}
.tile.revealing {
  animation: reveal 200ms ease-out;
}
@keyframes reveal {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}
#feedback {
  min-height: 37px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 4px 7px;
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: center;
}
#keyboard {
  max-width: 500px;
  margin: 0 auto;
}
.key-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 5px;
}
.key {
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  min-width: 0;
  min-height: 49px;
  padding: 5px 0;
  border: 1px solid #bcb5a8;
  border-radius: 0;
  background: #e5dfd3;
  font-size: 0.83rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.key.wide {
  flex: 1.5;
  font-size: 0.63rem;
}
.key-row:nth-child(2) {
  padding: 0 16px;
}
.key:active:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
}
.key.green {
  background: #a0c35a;
}
.key.yellow {
  background: #f9df6d;
}
.key.grey {
  background: #5f625f;
  color: var(--paper);
}
#board-return {
  margin: 14px 4px 0;
}
.text-button {
  border: 0;
  background: none;
  min-height: 44px;
  padding: 10px 0;
  font-size: 0.75rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#report {
  text-align: center;
  padding: 20px 4px 0;
}
.report-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
}
#report-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 9vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 10px;
  outline: none;
}
#report-score {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}
.scorecard-note,
#report-message {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 12px 0 18px;
}
#guess-history {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
#guess-history li {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 4px;
}
.guess-square {
  display: block;
  width: 16px;
  height: 16px;
  border: 1px solid #1112;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  padding: 11px 24px;
  font-size: 0.78rem;
  font-weight: 600;
}
.button.primary {
  background: var(--ink);
  color: var(--paper);
}
#copy {
  display: flex;
  margin: 10px auto 0;
}
#share-status {
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 8px 0;
}
#share-status:empty {
  margin: 0;
}
#manual-copy {
  width: 100%;
  height: 160px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 10px;
  margin-top: 10px;
  font:
    1rem system-ui,
    sans-serif;
}
.next-puzzle {
  border-top: 3px double var(--ink);
  padding-top: 20px;
  margin: 22px 0 6px;
}
.next-puzzle a {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 44px;
  font:
    700 1.4rem "Playfair Display",
    Georgia,
    serif;
  color: var(--ink);
  text-decoration: none;
}
.next-puzzle a:hover {
  text-decoration: underline;
}
#storage-notice {
  margin: 18px 4px 0;
  border-top: 1px solid #c8c0b2;
  padding-top: 10px;
  font-size: 0.78rem;
  line-height: 1.5;
}
@media (max-height: 700px) {
  .newspaper {
    padding-top: calc(8px + env(safe-area-inset-top));
  }
  .masthead h1 {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
    margin: 10px 0;
  }
  .edition-title {
    padding-bottom: 10px;
  }
  .instructions {
    margin: 12px 4px;
  }
  #board {
    width: min(100%, 245px);
  }
  #feedback {
    min-height: 30px;
    margin: 4px;
  }
}
@media (max-width: 350px) {
  .edition-line {
    font-size: 0.56rem;
  }
  #desk-label {
    font-size: 0.53rem;
  }
  .key-row {
    gap: 3px;
  }
  .key {
    font-size: 0.76rem;
  }
  .key.wide {
    font-size: 0.55rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
