:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #243d37;
  background: #f8f6ef;
  font-synthesis: none;
  --ink: #243d37;
  --green: #245b47;
  --muted: #5c6d64;
  --line: #d7ddd0;
  --tile: #f3f1e6;
  --lime: #d9ef9d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 16px;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid #a34322;
  outline-offset: 4px;
}
a {
  color: inherit;
}
.shell {
  max-width: 880px;
  margin: auto;
  padding: 0 28px;
}
header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 0;
  gap: 12px;
}
.tools {
  display: flex;
  gap: 8px;
}
.tools button {
  font-size: 12px;
  padding: 8px 12px;
  border-color: transparent;
}
.tools button:hover {
  background: #eaeedf;
}
main {
  max-width: 650px;
  margin: 0 auto;
}
.intro {
  text-align: center;
  padding: 16px 0 24px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.9px;
  color: var(--green);
  margin: 0 0 12px;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 6vw, 49px);
  font-weight: normal;
  letter-spacing: -2px;
  line-height: 1.13;
  margin: 0 0 14px;
}
.wordmark {
  margin: 6px 0 14px;
}
.wordmark-unknown {
  font-style: italic;
}
.instruction {
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
  color: #4c6157;
}
.instruction span {
  display: block;
}
.game-card {
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 5px 0 #e8eadf;
}
.board-heading,
.tray-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.board-heading {
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 700;
  margin-bottom: 13px;
}
.board-heading > span + span {
  font-size: 12px;
  letter-spacing: 0;
  font-weight: normal;
  color: var(--muted);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.tile {
  font-weight: 700;
  letter-spacing: 0.4px;
  font-size: 14px;
  min-height: 56px;
  background: var(--tile);
  border: 1px solid #dfe2d5;
  border-bottom: 3px solid #d4d9ca;
  padding: 10px 3px;
  transition:
    background 0.13s,
    transform 0.13s;
}
.tile:nth-last-child(2) {
  grid-column: 2;
}
.tile:hover:not([aria-disabled="true"]) {
  background: #e5edcf;
  transform: translateY(-2px);
}
.tile.selected {
  background: var(--green);
  border-color: var(--green);
  color: white;
  transform: translateY(-2px);
}
.tile[aria-disabled="true"] {
  background: #f8f8f3;
  color: #7c867d;
  border-style: dashed;
  border-bottom-width: 1px;
  text-decoration: line-through;
}
.tile.hinted {
  box-shadow: 0 0 0 3px #b96837;
  position: relative;
}
.tile.hinted:after {
  content: "✦";
  position: absolute;
  top: -10px;
  right: 3px;
  color: #9d471d;
  background: #fffef9;
  border-radius: 50%;
  font-size: 14px;
  padding: 0 2px;
}
.tray-heading {
  margin: 24px 0 12px;
}
.tray-heading h2 {
  font-size: 14px;
  margin: 0;
  font-weight: 600;
}
.tray-heading h2 span {
  font-weight: normal;
  margin-left: 8px;
  color: var(--muted);
}
.tray-heading > span {
  font-size: 11px;
  color: var(--muted);
}
.pairs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-height: 171px;
}
.pair,
.empty-pair {
  min-height: 37px;
  border-radius: 7px;
  font-size: 11px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 4px;
  gap: 5px;
}
.pair {
  background: #e9efdd;
  border: 1px solid #cddac1;
  animation: arrive 0.18s ease-out;
  min-height: 44px;
}
.pair b {
  font-size: 10px;
  font-weight: normal;
  color: #66745e;
}
.pair span {
  overflow-wrap: anywhere;
}
.empty-pair {
  border: 1px dashed #e0e3d7;
  color: #b0b9a7;
}
.pair:last-child,
.empty-pair:last-child {
  grid-column: 1/-1;
  max-width: calc(50% - 3.5px);
  width: 100%;
  justify-self: center;
}
.pair.hinted {
  border: 2px solid #a65328;
}
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-top: 22px;
}
.quiet {
  border-color: transparent;
  font-size: 13px;
  padding-left: 0;
}
.quiet span {
  margin-left: 10px;
}
.primary {
  background: var(--green);
  color: white;
  border: 1px solid var(--green);
  font-weight: 600;
  min-height: 48px;
  min-width: 170px;
}
.primary:hover {
  background: #183e31;
}
.primary:disabled {
  background: #e4e7dd;
  border-color: #e4e7dd;
  color: #6a756b;
}
#status {
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
  margin: 16px 0 0;
  min-height: 20px;
}
.daily-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  margin: 24px 0;
}
.daily-note span {
  font-size: 11px;
}
.result {
  text-align: center;
  padding: 30px 20px 16px;
}
.result h2,
dialog h2 {
  font-family: Georgia, serif;
  font-weight: normal;
  font-size: 34px;
  letter-spacing: -1px;
  margin: 10px 0;
}
.result p {
  line-height: 1.6;
  font-size: 14px;
}
.result ol {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
  margin: 20px 0;
}
.result li {
  padding: 9px 13px;
  background: #e9efdd;
  border-radius: 7px;
  font-size: 14px;
}
.stats {
  font-size: 13px;
  margin: 18px 0;
}
.result:not([hidden]) {
  animation: arrive 0.3s ease-out;
}
.result #view-puzzle {
  margin: 5px 6px 5px 0;
}
.tomorrow-note {
  max-width: 340px;
  margin: 16px auto;
  color: var(--muted);
}
#back-to-result {
  margin-bottom: 10px;
}
.solved .game-card {
  border-color: #99b67b;
}
.storage-note {
  font-size: 12px;
  text-align: center;
  color: #8c3e22;
}
footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 28px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 30px;
}
footer nav {
  display: flex;
  gap: 20px;
}
footer a {
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px;
  max-width: 470px;
  width: calc(100% - 30px);
  color: var(--ink);
  background: #fffef9;
  max-height: 85dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #183e3166;
  backdrop-filter: blur(3px);
}
dialog p,
dialog li {
  font-size: 14px;
  line-height: 1.65;
}
dialog ol {
  padding-left: 22px;
}
dialog li {
  padding-bottom: 7px;
}
dialog .close {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 24px;
  border: 0;
}
.example {
  background: #e9efdd;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  font-weight: bold;
}
.example span {
  display: block;
  margin-top: 7px;
}
.small {
  font-size: 12px !important;
  color: var(--muted);
}
textarea {
  width: 100%;
  font: inherit;
  line-height: 1.6;
  padding: 12px;
  margin-top: 10px;
}
#share-fallback {
  margin: 20px 0;
  font-size: 13px;
}
.skip {
  position: fixed;
  left: 10px;
  top: -80px;
  background: white;
  padding: 12px;
  z-index: 10;
}
.skip:focus {
  top: 10px;
}
[hidden] {
  display: none !important;
}
.article {
  padding: 42px 0;
  line-height: 1.8;
}
.article h1 {
  font-size: 38px;
}
.article p,
.article li {
  font-size: 16px;
}
.activity-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin: 28px 0;
}
.activity-totals dd {
  margin: 0;
  font: bold 1.75rem/1.4 Georgia, serif;
}
.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.activity-table caption { text-align: left; font-weight: bold; }
.activity-table th, .activity-table td {
  text-align: right;
  padding: 7px 3px;
  border-bottom: 1px solid var(--line);
}
.activity-table th:first-child { text-align: left; }
@keyframes arrive {
  from {
    opacity: 0.5;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.checking {
  animation: arrive 0.2s ease-out;
}
@media (max-width: 550px) {
  .wordmark {
    font-size: 34px;
    letter-spacing: -1.5px;
  }
  .shell {
    padding: 0 16px;
  }
  header {
    padding: 14px 0;
  }
  .tools button {
    padding: 8px;
    font-size: 11px;
  }
  .intro {
    padding: 24px 0 20px;
  }
  h1 {
    font-size: 36px;
  }
  .instruction {
    font-size: 13px;
  }
  .game-card {
    padding: 18px 14px;
    border-radius: 17px;
  }
  .tiles {
    gap: 7px;
  }
  .tile {
    font-size: 12px;
    letter-spacing: 0;
    min-height: 52px;
  }
  .tray-heading {
    margin-top: 20px;
  }
  .pairs {
    gap: 6px;
  }
  .pair {
    font-size: 10px;
  }
  .actions {
    gap: 8px;
  }
  .primary {
    min-width: 150px;
  }
  .quiet {
    font-size: 12px;
  }
  .spark {
    font-size: 18px;
  }
  footer {
    font-size: 10px;
    flex-wrap: wrap;
  }
  .tray-heading > span {
    font-size: 10px;
  }
}
@media (max-width: 350px) {
  .shell {
    padding: 0 10px;
  }
  .game-card {
    padding: 15px 10px;
  }
  .tile {
    font-size: 11px;
  }
  .primary {
    min-width: 130px;
  }
  h1 {
    font-size: 31px;
  }
  .instruction {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Keep the tray steady as tentative pairs fill it. */
.empty-pair {
  min-height: 44px;
}
.pairs {
  min-height: 197px;
}
@media (max-width: 430px) {
  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tile {
    font-size: 12px;
  }
  .tile:nth-last-child(2) {
    grid-column: auto;
  }
  .tile:last-child {
    grid-column: auto;
  }
}

@media (max-width: 550px) {
  .actions {
    position: sticky;
    bottom: 0;
    background: #fffef9;
    padding: 12px 0;
    margin-top: 10px;
    z-index: 2;
    border-top: 1px solid var(--line);
  }
  .pair {
    font-size: 11px;
  }
}

@media (min-width: 700px) {
  .tiles {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
  }
  .tile {
    font-size: 13px;
    letter-spacing: 0;
    min-height: 54px;
  }
  .tile:nth-last-child(2) {
    grid-column: auto;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The owner dashboard uses the daily game's evergreen and cream palette. */
.stats-page {
  background: #103d33;
  color: #fff4da;
  min-height: 100vh;
  min-height: 100svh;
}
.stats-page .shell {
  max-width: 760px;
  padding: clamp(24px, 6vh, 64px) clamp(16px, 4vw, 32px);
}
.stats-page header, .stats-page footer { justify-content: center; }
.stats-brand {
  display: inline-flex;
  align-items: center;
  font: 32px/1 Georgia, serif;
  letter-spacing: -1.4px;
  text-decoration: none;
}
.stats-page .article {
  background: #fff8e9;
  color: #173e32;
  border-radius: 20px;
  margin: 24px auto 0;
  padding: clamp(24px, 4vw, 46px) clamp(16px, 4vw, 36px);
  text-align: center;
}
.stats-page .article h1 {
  font-size: clamp(36px, 6vw, 48px);
  margin: 0 0 20px;
}
.stats-page .article p { line-height: 1.55; }
.stats-page .article:has(.g_id_signin) { max-width: 480px; }
.stats-page .g_id_signin {
  display: flex;
  justify-content: center;
  margin: 24px auto 0;
}
.stats-periods {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  background: #ebe9db;
  border-radius: 16px;
  padding: 4px;
}
.stats-periods > * {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  text-decoration: none;
}
.stats-periods [aria-current] { color: #fff4da; background: #245746; }
.stats-periods a:hover { text-decoration: underline; }
.stats-page .activity-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 10px);
  margin: 28px 0 32px;
}
.stats-page .activity-totals div {
  padding: 14px 3px;
  border: 1px solid #d9dbcb;
  border-radius: 10px;
  background: #f3f1e6;
}
.stats-page .activity-totals dt { font-size: .875rem; line-height: 1.3; }
.stats-page .activity-totals dd { font: 2rem/1.25 Georgia, serif; margin-top: 4px; }
.stats-page .activity-table { line-height: 1.4; }
.stats-page .activity-table caption {
  margin-bottom: 12px;
  font: 1.5rem/1.3 Georgia, serif;
}
.stats-page .activity-table small {
  display: inline-block;
  font: .8125rem/1.4 Arial, sans-serif;
  color: #51655b;
  margin-left: 4px;
}
.stats-page .activity-table th, .stats-page .activity-table td { padding: 10px 4px; }
.stats-page .activity-table thead { background: #eeefe1; }
.stats-page footer {
  margin: 20px auto 0;
  gap: 24px;
  border: 0;
  color: #e0e8dd;
  font-size: .875rem;
  align-items: center;
  flex-direction: row;
}
@media (max-width: 440px) {
  .stats-periods > * { padding-inline: 8px; }
  .stats-page .activity-totals dt { min-height: 2.6em; }
  .stats-page .activity-table { font-size: .875rem; }
}
