/* ============================================================
   SEO Wordle — daily marketing word game
   ============================================================ */

.wordle-page {
  --wd-tile-size: clamp(48px, 14vw, 62px);
  --wd-gap: 6px;
  --wd-correct: #6AAA64;   /* right letter, right spot */
  --wd-present: #C9A227;   /* right letter, wrong spot */
  --wd-absent:  #787C7E;   /* not in the word */
  --wd-border:  var(--wire-stroke);
  --wd-border-filled: var(--graphite);
}

/* ---- Play layout ---- */
.wordle-play {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-bottom: clamp(40px, 6vw, 80px);
}

/* ---- Board ---- */
.wordle-board {
  display: flex;
  flex-direction: column;
  gap: var(--wd-gap);
  user-select: none;
  touch-action: manipulation;
}
.wd-row {
  display: flex;
  gap: var(--wd-gap);
}
.wd-tile {
  width: var(--wd-tile-size);
  height: var(--wd-tile-size);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--wd-border);
  border-radius: 6px;
  background: var(--canvas);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: calc(var(--wd-tile-size) * 0.46);
  text-transform: uppercase;
  color: var(--ink);
  box-sizing: border-box;
  transition: border-color 90ms var(--ease-standard),
              transform 90ms var(--ease-standard);
}
.wd-tile__face { line-height: 1; }
.wd-tile.is-filled { border-color: var(--wd-border-filled); }
.wd-tile.is-pop { animation: wd-pop 110ms var(--ease-standard); }
@keyframes wd-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Row shake for an invalid guess. */
.wd-row.is-invalid { animation: wd-shake 420ms; }
@keyframes wd-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* Reveal flip on submit. */
.wd-tile.is-reveal { animation: wd-flip 500ms ease forwards; }
@keyframes wd-flip {
  0%   { transform: rotateX(0); }
  50%  { transform: rotateX(-90deg); }
  100% { transform: rotateX(0); }
}

/* Scored states (applied at the flip midpoint). */
.wd-tile.is-correct { background: var(--wd-correct); border-color: var(--wd-correct); color: #fff; }
.wd-tile.is-present { background: var(--wd-present); border-color: var(--wd-present); color: #fff; }
.wd-tile.is-absent  { background: var(--wd-absent);  border-color: var(--wd-absent);  color: #fff; }

/* Win bounce. */
.wd-row.is-win .wd-tile { animation: wd-bounce 600ms var(--ease-reveal); }
.wd-row.is-win .wd-tile:nth-child(2) { animation-delay: 80ms; }
.wd-row.is-win .wd-tile:nth-child(3) { animation-delay: 160ms; }
.wd-row.is-win .wd-tile:nth-child(4) { animation-delay: 240ms; }
.wd-row.is-win .wd-tile:nth-child(5) { animation-delay: 320ms; }
@keyframes wd-bounce {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-16px); }
  60%      { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .wd-tile.is-pop, .wd-tile.is-reveal, .wd-row.is-invalid,
  .wd-row.is-win .wd-tile { animation: none !important; }
}

/* ---- Message line ---- */
.wordle-msg {
  min-height: 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
}
.wordle-msg.is-error { color: #C0392B; }

/* ---- Optional clue ---- */
.wordle-clue { text-align: center; }
.wordle-clue__toggle {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--graphite);
  background: none;
  border: none;
  border-bottom: 1px dashed var(--wire-stroke);
  cursor: pointer;
  padding: 0 0 2px;
  transition: color 120ms var(--ease-standard);
}
.wordle-clue__toggle:hover { color: var(--ink); }
.wordle-clue__text {
  margin: 12px auto 0;
  max-width: 440px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  padding: 12px 16px;
  background: var(--paper);
  border-radius: var(--radius-sm);
}

/* ---- On-screen keyboard ---- */
.wordle-keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 500px;
  margin-top: 6px;
}
.wd-krow {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.wd-key {
  flex: 1 1 auto;
  min-width: 0;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: background 90ms var(--ease-standard), color 90ms var(--ease-standard),
              transform 90ms var(--ease-standard);
}
.wd-key:hover { background: var(--hairline); }
.wd-key:active { transform: translateY(1px); }
.wd-key--wide { flex: 1.5 1 auto; font-size: 12px; }
.wd-key.is-correct { background: var(--wd-correct); color: #fff; }
.wd-key.is-present { background: var(--wd-present); color: #fff; }
.wd-key.is-absent  { background: var(--wd-absent);  color: #fff; }

@media (max-width: 500px) {
  .wd-key { height: 48px; font-size: 13px; }
  .wordle-keyboard { gap: 6px; }
  .wd-krow { gap: 5px; }
}

/* ---- Result / definition, revealed on game end ---- */
.wordle-result {
  width: 100%;
  max-width: 520px;
  margin-top: 8px;
  padding: 22px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--paper);
  animation: wd-result-in 400ms var(--ease-reveal) both;
}
@keyframes wd-result-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wordle-result__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.wordle-result__badge {
  font-size: 14px;
  font-weight: 600;
}
.wordle-result__badge.is-win  { color: var(--positive); }
.wordle-result__badge.is-lose { color: #C0392B; }
.wordle-result__word {
  font-size: 15px;
  color: var(--ink);
}
.wordle-result__word strong {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--signal);
}
.wordle-result__blurb {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--graphite);
}

/* ---- Share buttons ---- */
.wordle-share__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wordle-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms var(--ease-standard),
              border-color 120ms var(--ease-standard),
              color 120ms var(--ease-standard),
              transform 120ms var(--ease-standard);
}
.wordle-share__btn svg { flex: 0 0 auto; }
.wordle-share__btn:hover { transform: translateY(-1px); border-color: var(--wire-stroke); }
.wordle-share__btn--x:hover  { background: #000; color: #fff; border-color: #000; }
.wordle-share__btn--li:hover { background: #0A66C2; color: #fff; border-color: #0A66C2; }
.wordle-share__btn--copy.is-copied {
  background: var(--positive); color: #fff; border-color: var(--positive);
}

/* Fallback for .btn--ghost (shared with the crossword). */
.btn.btn--ghost {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 120ms var(--ease-standard), border-color 120ms var(--ease-standard);
}
.btn.btn--ghost:hover { background: var(--paper); border-color: var(--wire-stroke); }

/* ---- Prev / archive / next nav ---- */
.wordle-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 24px 0 clamp(48px, 8vw, 96px);
  border-top: 1px solid var(--hairline);
  margin-top: 8px;
}
.wordle-nav > div:first-child  { text-align: left; }
.wordle-nav > div:nth-child(2) { text-align: center; }
.wordle-nav > div:last-child   { text-align: right; }
.wordle-nav__link {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms;
}
.wordle-nav__link:hover { border-bottom-color: var(--ink); }

/* ---- Archive grid ---- */
.wordle-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.wordle-archive-card {
  display: block;
  padding: 12px 14px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  transition: background 120ms var(--ease-standard);
}
.wordle-archive-card:hover { background: var(--hairline); }
.wordle-archive-card__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  margin-bottom: 4px;
}
.wordle-archive-card__theme { font-size: 14px; font-weight: 500; }

/* ============================================================
   Playground hub — /wordle/ landing page
   ============================================================ */

.wd-hub-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
}
.wd-hub-cta__meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--graphite);
}

/* ---- Calendar ---- */
.wd-cal { max-width: 620px; }
.wd-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.wd-cal__title {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.wd-cal__nav { display: flex; gap: 8px; }
.wd-cal__navbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--canvas);
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  transition: background 120ms var(--ease-standard), border-color 120ms var(--ease-standard);
}
.wd-cal__navbtn:hover { background: var(--paper); border-color: var(--wire-stroke); }
.wd-cal__navbtn.is-disabled { opacity: 0.35; pointer-events: none; }

.wd-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.wd-cal__dow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--graphite);
  text-align: center;
  padding-bottom: 6px;
}
.wd-cal__cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  padding: 6px;
  overflow: hidden;
}
.wd-cal__cell--blank { background: transparent; }
.wd-cal__cell--empty { background: var(--paper); opacity: 0.5; }
.wd-cal__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--graphite);
  line-height: 1;
}
a.wd-cal__day {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #EAF3E7;   /* soft wordle-green tint */
  color: var(--ink);
  text-decoration: none;
  transition: background 120ms var(--ease-standard), transform 120ms var(--ease-standard);
}
a.wd-cal__day .wd-cal__num { color: var(--wd-correct, #6AAA64); font-weight: 600; }
a.wd-cal__day:hover { background: #D8EAD2; transform: translateY(-1px); }
.wd-cal__theme {
  font-size: 11px;
  line-height: 1.2;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.wd-cal__today {
  position: absolute;
  top: 6px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: #6AAA64;
  border-radius: 3px;
  padding: 1px 4px;
  line-height: 1.3;
}
.wd-cal__cell.is-today { box-shadow: inset 0 0 0 2px #6AAA64; }
.wd-cal__foot {
  margin-top: 18px;
  font-size: 14px;
  color: var(--graphite);
}
.wd-cal__foot a { color: var(--signal); text-decoration: none; }
.wd-cal__foot a:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .wd-cal__theme { display: none; }
  .wd-cal__cell { padding: 5px; }
}

/* ---- Content columns ---- */
.wd-hub-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
}
@media (max-width: 760px) {
  .wd-hub-cols { grid-template-columns: 1fr; gap: 40px; }
}
.wd-hub-p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--graphite);
  margin: 0 0 16px;
  max-width: 560px;
}
.wd-hub-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wd-hub-list li {
  font-size: 16px;
  line-height: 1.5;
  color: var(--graphite);
  padding-left: 18px;
  position: relative;
}
.wd-hub-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: #6AAA64;
}
.wd-hub-list strong { color: var(--ink); font-weight: 600; }
