/* Free Press Games — shared chrome (homepage + game shells) */

@font-face {
  font-family: "Copernicus";
  src: url("thefp/CopernicusNewCond-090.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "American Grotesk";
  src: url("thefp/american-grotesk-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "American Grotesk Condensed";
  src: url("thefp/american-grotesk-condensed-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: #f6f4ef;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 5px solid #000;
}

/* While a modal is open: hard-lock page rubber-banding */
html.fp-modal-open,
html.fp-modal-open body,
body.fp-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none;
}

/* Modal card chrome clips overscroll; only .modal-scroll moves */
.modal-content,
.overlay > .modal,
.modal-overlay > .modal,
.modalinner,
.help-modal-card,
.confirm-modal-card {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  display: flex !important;
  flex-direction: column !important;
  background: #fff;
}

.modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.modal-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Homepage only — don't override Zanagrams game fonts */
body.fp-home {
  font-family: "American Grotesk", system-ui, sans-serif;
}

/* Hub chrome is visible by default. First-visit hide is only in index.html
   (html:not(.fp-hub-ready) …) so Back from a game never fades from opacity 0. */
body.fp-home.fp-hub-fade > .fp-header,
body.fp-home.fp-hub-fade > .fp-games,
body.fp-home.fp-hub-fade > .fp-footer-wrap {
  opacity: 0;
}

body.fp-home.fp-hub-fade.loaded > .fp-header,
body.fp-home.fp-hub-fade.loaded > .fp-games,
body.fp-home.fp-hub-fade.loaded > .fp-footer-wrap {
  opacity: 1;
  transition: opacity 0.28s ease;
}

/* Old full-page loaders stay off — we use an inline game-area spinner instead */
.fp-puz-loader,
.fp-loader,
.puz-loader,
.loader-overlay {
  display: none !important;
}

/*
  Game pages: header/footer show immediately.
  Hide game content until localStorage restore / puzzle load finishes,
  and show a small spinner in the game column only (no page overlay).
*/
body.fp-game .game-shell,
body.fp-game .app {
  position: relative;
  min-height: 280px;
  opacity: 1;
  transform: none;
}

body.fp-game:not(.loaded) .game-shell > *,
body.fp-game:not(.loaded) .app > * {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.fp-game:not(.loaded) .game-shell::after,
body.fp-game:not(.loaded) .app::after {
  content: "";
  position: absolute;
  top: 180px;
  left: 50%;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  box-sizing: border-box;
  border: 2.5px solid rgba(26, 26, 26, 0.14);
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: fpSpin 0.65s linear infinite;
  z-index: 20;
}

@keyframes fpSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  body.fp-home.fp-hub-fade.loaded > .fp-header,
  body.fp-home.fp-hub-fade.loaded > .fp-games,
  body.fp-home.fp-hub-fade.loaded > .fp-footer-wrap {
    transition: none;
  }
  body.fp-game:not(.loaded) .game-shell::after,
  body.fp-game:not(.loaded) .app::after {
    animation: none;
    border-top-color: rgba(26, 26, 26, 0.35);
  }
}

/* Shared completion-screen line reveal (all games) */
.complete-screen .c-line,
.results.complete-screen > .c-line {
  opacity: 0;
}

.complete-screen.show .c-line,
.results.complete-screen.show > .c-line {
  animation: fpRiseIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Equal spacing; first line is instant (0s) */
.complete-screen.show:not(.instant) .c-line:nth-child(1),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(1) { animation-delay: 0s; }
.complete-screen.show:not(.instant) .c-line:nth-child(2),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(2) { animation-delay: 0.4s; }
.complete-screen.show:not(.instant) .c-line:nth-child(3),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(3) { animation-delay: 0.8s; }
.complete-screen.show:not(.instant) .c-line:nth-child(4),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(4) { animation-delay: 1.2s; }
.complete-screen.show:not(.instant) .c-line:nth-child(5),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(5) { animation-delay: 1.6s; }
.complete-screen.show:not(.instant) .c-line:nth-child(6),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(6) { animation-delay: 2s; }
.complete-screen.show:not(.instant) .c-line:nth-child(7),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(7) { animation-delay: 2.4s; }
.complete-screen.show:not(.instant) .c-line:nth-child(8),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(8) { animation-delay: 2.8s; }
.complete-screen.show:not(.instant) .c-line:nth-child(9),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(9) { animation-delay: 3.2s; }
.complete-screen.show:not(.instant) .c-line:nth-child(10),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(10) { animation-delay: 3.6s; }
.complete-screen.show:not(.instant) .c-line:nth-child(11),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(11) { animation-delay: 4s; }
.complete-screen.show:not(.instant) .c-line:nth-child(12),
.results.complete-screen.show:not(.instant) > .c-line:nth-child(12) { animation-delay: 4.4s; }

/* Revisit after solving: every line rises together */
.complete-screen.show.instant .c-line,
.results.complete-screen.show.instant > .c-line {
  animation-delay: 0s !important;
}

@keyframes fpRiseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* Shared completion action buttons (Sunflowers style) */
.complete-screen .btn,
.results.complete-screen .btn,
#result .btn.btn-share,
#resultActions .btn {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 800;
  font-size: 17px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #fff;
  padding: 15px 18px;
}

.complete-screen .btn:active,
.results.complete-screen .btn:active,
#result .btn:active,
#resultActions .btn:active {
  transform: scale(0.98);
}

.complete-screen .share-actions,
.results.complete-screen .share-actions,
#result .share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.complete-screen .share-actions .btn,
.results.complete-screen .share-actions .btn,
#result .share-actions .btn {
  flex: 0 0 auto;
  width: fit-content;
  white-space: nowrap;
  margin: 0;
}

.complete-screen .btn-share,
.results.complete-screen .btn-share,
.results.complete-screen .share.button,
#result .btn-share {
  background: #2e9e5b;
  box-shadow: 0 8px 20px rgba(46, 158, 91, 0.28);
}

.complete-screen .btn-share:hover,
.results.complete-screen .btn-share:hover,
.results.complete-screen .share.button:hover,
#result .btn-share:hover {
  background: #278a4f;
}

.complete-screen .btn-share svg,
.results.complete-screen .btn-share svg,
.results.complete-screen .share.button svg,
#result .btn-share svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.complete-screen .c-result-actions,
.results.complete-screen .c-result-actions,
#resultActions.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

.complete-screen .btn-secondary,
.results.complete-screen .btn-secondary,
#resultActions .btn-secondary,
.complete-screen a.btn-secondary,
.results.complete-screen a.btn-secondary,
#resultActions a.btn-secondary {
  background: transparent !important;
  color: #1a1a1a !important;
  border: 3px solid #1a1a1a !important;
  box-shadow: none !important;
  padding: 13px 36px !important;
  width: fit-content !important;
  margin: 0 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

@media (hover: hover) and (pointer: fine) {
  .complete-screen .btn-secondary:hover,
  .results.complete-screen .btn-secondary:hover,
  #resultActions .btn-secondary:hover,
  .complete-screen a.btn-secondary:hover,
  .results.complete-screen a.btn-secondary:hover,
  #resultActions a.btn-secondary:hover {
    background: #1a1a1a !important;
    color: #fff !important;
    border-color: #1a1a1a !important;
  }
}
/* Mobile: no sticky hover invert; subtle press feedback only */
@media (hover: none), (pointer: coarse) {
  .complete-screen .btn-secondary,
  .results.complete-screen .btn-secondary,
  #resultActions .btn-secondary,
  .complete-screen a.btn-secondary,
  .results.complete-screen a.btn-secondary,
  #resultActions a.btn-secondary {
    transition: background 0.12s ease, transform 0.12s ease, color 0.12s ease !important;
    -webkit-tap-highlight-color: transparent;
  }
  .complete-screen .btn-secondary:hover,
  .results.complete-screen .btn-secondary:hover,
  #resultActions .btn-secondary:hover,
  .complete-screen a.btn-secondary:hover,
  .results.complete-screen a.btn-secondary:hover,
  #resultActions a.btn-secondary:hover {
    background: transparent !important;
    color: #1a1a1a !important;
    border-color: #1a1a1a !important;
    transform: none !important;
  }
  .complete-screen .btn-secondary:active,
  .results.complete-screen .btn-secondary:active,
  #resultActions .btn-secondary:active,
  .complete-screen a.btn-secondary:active,
  .results.complete-screen a.btn-secondary:active,
  #resultActions a.btn-secondary:active {
    background: rgba(26, 26, 26, 0.08) !important;
    color: #1a1a1a !important;
    border-color: #1a1a1a !important;
    transform: scale(0.97) !important;
  }
}

/* Shared monthly archive calendar */
.fp-archive-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.fp-archive-overlay.show {
  display: flex;
}

.fp-archive-card {
  position: relative;
  width: min(400px, 100%);
  max-height: min(72dvh, calc(100dvh - 96px));
  overflow: auto;
  background: #fff;
  border: 2px solid #1a1a1a;
  border-radius: 12px;
  padding: 28px 20px 20px;
  box-sizing: border-box;
  font-family: 'Baloo 2', system-ui, sans-serif;
  color: #1a1a1a;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.fp-archive-card::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.fp-archive-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #2b2b2b;
  font-size: 26px;
  font-weight: 600;
  line-height: 36px;
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
}

.fp-archive-x:hover {
  background: rgba(0, 0, 0, 0.06);
}

.fp-archive-title {
  margin: 0 0 16px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.fp-archive-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.fp-archive-month {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}

.fp-archive-nav-btn {
  width: 36px;
  height: 36px;
  border: 2px solid #e5e1d6;
  border-radius: 8px;
  background: #f6f4ef;
  color: #1a1a1a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.fp-archive-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.fp-archive-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.fp-archive-dow span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #8a8a8a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fp-archive-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 12px;
}

.fp-archive-cell {
  aspect-ratio: 1 / 1.08;
  min-height: 46px;
  border: 1.5px dashed #cfc9bb;
  border-radius: 10px;
  background: #fff;
  padding: 4px 2px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  font: inherit;
  color: #8a867c;
}

.fp-archive-cell.is-pad {
  border: none;
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.fp-archive-cell.is-disabled {
  opacity: 0.22;
  cursor: default;
  border-style: solid;
  border-color: #ece9e0;
  background: #f6f4ef;
  color: #b8b4a8;
}

/* Not played yet — open / dashed */
.fp-archive-cell.is-empty {
  border-style: dashed;
  border-color: #cfc9bb;
  background: #fff;
  color: #8a867c;
}

.fp-archive-cell.is-empty .fp-archive-score {
  color: #a39e90;
  font-weight: 700;
}

/* Completed — solid green */
.fp-archive-cell.is-done {
  border-style: solid;
  border-color: #2e9e5b;
  background: #2e9e5b;
  color: #fff;
}

.fp-archive-cell.is-done .fp-archive-num,
.fp-archive-cell.is-done .fp-archive-score {
  color: #fff;
}

/* In progress — solid blue tint */
.fp-archive-cell.is-progress {
  border-style: solid;
  border-color: #4169f1;
  background: #e8edff;
  color: #2f50d8;
}

.fp-archive-cell.is-progress .fp-archive-score {
  color: #2f50d8;
}

/* Failed — solid warm red tint */
.fp-archive-cell.is-failed {
  border-style: solid;
  border-color: #d64545;
  background: #fdecec;
  color: #b53636;
}

.fp-archive-cell.is-failed .fp-archive-score {
  color: #b53636;
}

.fp-archive-cell.is-today:not(.is-done) {
  box-shadow: 0 0 0 2px #1a1a1a;
}

.fp-archive-cell.is-today.is-done {
  box-shadow: 0 0 0 2px #1a1a1a;
}

.fp-archive-cell:not(.is-disabled):not(.is-pad):hover {
  transform: translateY(-1px);
}

.fp-archive-num {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.05;
}

.fp-archive-score {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fp-archive-close-btn {
  display: block;
  width: 100%;
  border: 2px solid #1a1a1a;
  background: #1a1a1a;
  color: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.fp-header,
.fp-subheader,
.fp-games,
.content {
  width: 100%;
  max-width: 1403px;
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

.fp-footer-wrap {
  align-self: stretch;
  width: 100%;
  background: #161613;
  display: flex;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
}

.fp-footer {
  width: 100%;
  max-width: 1403px;
  display: block;
  line-height: 0;
}

.fp-header a,
.fp-footer a {
  display: block;
}

.fp-header img,
.fp-subheader img,
.fp-footer img {
  width: 100%;
  max-width: 1403px;
  height: auto;
  display: block;
}

.fp-header img {
  margin-left: -1px;
  margin-top: -1px;
}

.fp-header img.mobile,
.fp-subheader img.mobile,
.fp-footer img.mobile {
  /* Keep out of document flow so it can never stack above/below the visible header */
  display: none;
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.fp-games {
  flex: 1;
  min-height: 700px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  padding: 64px 20px 96px 48px;
  background: #f6f4ef;
  line-height: normal;
  box-sizing: border-box;
}

.fp-games-title {
  margin: 0 0 8px;
  font-family: "Copernicus", Georgia, serif;
  font-weight: 600;
  font-style: normal;
  font-size: 110px;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: #161613;
}

.fp-games-sub {
  margin: 0 0 44px;
  padding-bottom: 44px;
  width: 100%;
  align-self: stretch;
  font-family: "American Grotesk", system-ui, sans-serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
  color: #161613;
  border-bottom: 4px solid #000;
}

.fp-games-sub em {
  font-style: italic;
  font-family: inherit;
}

.fp-play-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: clamp(14px, 2vw, 32px);
  row-gap: clamp(28px, 3vw, 48px);
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.fp-play-card {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0 0 16px;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid #c8c8c8;
  border-radius: 0;
  box-shadow: none;
  font: inherit;
  color: inherit;
}

.fp-play-beta {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-family: "American Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: #f22f2c;
  padding: 4px 7px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.fp-gate-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  padding: 20px;
  box-sizing: border-box;
}

/* Sit above the archive calendar (z-index 10000) */
.fp-gate-modal.fp-archive-gate {
  z-index: 10050;
}

.fp-gate-modal.show {
  display: flex;
}

.fp-gate-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 2px solid #1a1a1a;
  border-radius: 12px;
  padding: 32px 24px 24px;
  text-align: center;
  box-sizing: border-box;
}

.fp-gate-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: #1a1a1a;
  font-size: 26px;
  font-weight: 600;
  line-height: 36px;
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
}

.fp-gate-x:hover {
  background: rgba(0, 0, 0, 0.06);
}

.fp-gate-eyebrow {
  margin: 0 0 8px;
  font-family: "American Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f22f2c;
}

.fp-gate-title {
  margin: 0 0 12px;
  font-family: "American Grotesk Condensed", "American Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.15;
  color: #161613;
}

.fp-gate-body {
  margin: 0 0 22px;
  font-family: "American Grotesk", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: #161613;
}

.fp-gate-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 0 0 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #f22f2c;
  color: #fff;
  font-family: "American Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  box-sizing: border-box;
}

.fp-gate-cta:hover {
  background: #d92623;
}

.fp-gate-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  border: none;
  background: none;
  color: #616162;
  font-family: "American Grotesk", system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  padding: 8px;
}

.fp-gate-dismiss:hover {
  color: #161613;
}

.fp-play-thumb-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.fp-play-thumb-link:hover .fp-play-thumb {
  opacity: 0.88;
}

.fp-play-thumb-link:focus {
  outline: none;
}

.fp-play-thumb-link:focus-visible .fp-play-thumb {
  outline: 2px solid #4169f1;
  outline-offset: 3px;
}

.fp-play-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 0 10px;
  background: #e9e6df;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.fp-play-thumb img {
  width: 58%;
  height: 58%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.fp-play-copy {
  margin: 0 0 10px;
  line-height: normal;
}

.fp-play-name {
  margin: 0 0 4px;
  font-family: "American Grotesk Condensed", "American Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: clamp(16px, 1.45vw, 22px);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #161613;
}

.fp-play-name a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.fp-play-name a:hover,
.fp-play-name a:focus-visible {
  color: #f22f2c;
}

.fp-play-tagline {
  margin: 0;
  font-family: "American Grotesk", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(11px, 0.95vw, 13px);
  line-height: 1.25;
  color: #161613;
}

.fp-play-actions {
  display: none; /* temporarily hidden — re-enable with display: grid */
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.fp-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 6px;
  border-radius: 999px;
  border: 2px solid #161613;
  font-family: "American Grotesk", system-ui, sans-serif;
  font-size: clamp(11px, 0.9vw, 12px);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
  transition: background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}

.fp-play-btn-primary {
  background: #161613;
  color: #f6f4ef;
}

.fp-play-btn-primary:hover {
  background: #2b2b2b;
  border-color: #2b2b2b;
}

.fp-play-btn-secondary {
  background: transparent;
  color: #161613;
}

.fp-play-btn-secondary:hover {
  background: rgba(22, 22, 19, 0.06);
}

.fp-play-btn:focus {
  outline: none;
}

.fp-play-btn:focus-visible {
  outline: 2px solid #4169f1;
  outline-offset: 2px;
}

/* Individual games on mobile: lock page scroll, pin footer, tighten header gap */
@media (max-width: 768px) {
  html:has(body.fp-game) {
    height: 100%;
    overflow: hidden;
  }

  body.fp-game {
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: none;
    display: flex !important;
    flex-direction: column !important;
  }

  body.fp-game .fp-header {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
  }

  body.fp-game .content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Keep clear of the FP header image on mobile */
    margin-top: 0;
    position: relative;
    z-index: 1;
  }

  body.fp-game .fp-footer-wrap {
    flex-shrink: 0;
    margin-top: auto;
    position: relative;
    z-index: 20;
  }

  /* Modals are body children — cover header/footer and fit the phone viewport.
     Only target overlay roots (not inner .modal cards in Zanagrams/Word Snake). */
  body.fp-game > .modal,
  body.fp-game > .overlay,
  body.fp-game > .modal-overlay,
  body.fp-game > .help-modal,
  body.fp-game > .confirm-modal,
  body.fp-game > .modals > .modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    z-index: 10000 !important;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
  }

  /* Center only when open — don't force display on hidden overlays */
  body.fp-game > .modal.active,
  body.fp-game > .overlay.open,
  body.fp-game > .modal-overlay.show,
  body.fp-game > .modal-overlay.active,
  body.fp-game > .help-modal.show,
  body.fp-game > .confirm-modal.show,
  body.fp-game > .modals > .modal:not(.hidden) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body.fp-game > .modal > .modal-content,
  body.fp-game > .overlay > .modal,
  body.fp-game > .modal-overlay > .modal,
  body.fp-game > .modals .modalinner,
  body.fp-game > .help-modal > .help-modal-card,
  body.fp-game > .confirm-modal > .confirm-modal-card {
    max-height: min(58dvh, calc(100dvh - 96px)) !important;
    width: min(400px, 100%) !important;
    margin: 0 auto !important;
    flex-shrink: 1 !important;
  }
}

@media (max-width: 768px) {
  .fp-header img.desktop,
  .fp-subheader img.desktop,
  .fp-footer img.desktop {
    display: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
  }

  .fp-header img.mobile,
  .fp-subheader img.mobile {
    display: block;
    position: static;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .fp-footer-wrap,
  .fp-footer img.mobile {
    display: none !important;
  }

  .fp-games {
    padding: 48px 20px 80px;
  }

  .fp-games-title {
    font-size: 46px;
  }

  .fp-games-sub {
    font-size: 18px;
  }

  .fp-play-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 32px;
  }

  .fp-play-card {
    width: 100%;
  }

  .fp-play-thumb {
    width: 100%;
  }

  .fp-play-name {
    font-size: 22px;
  }

  .fp-play-tagline {
    font-size: 14px;
  }

  .fp-play-btn {
    min-height: 32px;
    font-size: 12px;
    padding: 6px 7px;
  }
}

@media (max-width: 1100px) and (min-width: 769px) {
  .fp-play-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 40px;
  }

  .fp-play-name {
    font-size: 24px;
  }

  .fp-play-tagline {
    font-size: 13px;
  }
}

/* Shared How to play body — simple left-aligned prose for all games */
.fp-how {
  text-align: left;
  max-width: 340px;
  margin: 0 auto;
  padding: 0 4px;
}
.fp-how p,
.help-modal-card .fp-how p,
.content-modal .fp-how p,
.modal .fp-how p {
  margin: 0 0 22px;
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.5;
  color: #1c1c1e;
  text-align: left;
}
.fp-how p:last-child {
  margin-bottom: 0;
}
/* How to play dismiss — black pill, shared across games */
button.fp-how-got-it,
.fp-how-got-it {
  display: block;
  width: auto !important;
  max-width: none;
  align-self: center;
  margin: 20px auto 0;
  padding: 11px 28px !important;
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: 17px !important;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 999px;
  background: #1a1a1a !important;
  border: 2px solid #1a1a1a !important;
  color: #fff !important;
  box-shadow: none !important;
}
button.fp-how-got-it:hover,
.fp-how-got-it:hover {
  background: #2f2f2f !important;
  border-color: #2f2f2f !important;
  color: #fff !important;
}
/* Desktop-only control lines (mouse / fine pointer) */
.fp-how-desktop {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .fp-how-desktop {
    display: block;
  }
}

/* Mobile landscape — ask to rotate back to portrait */
.fp-rotate-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 80% 70% at 50% 40%, #fffdf8 0%, #f6f4ef 55%, #ebe6db 100%);
  color: #161613;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.fp-rotate-gate-inner {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.fp-rotate-gate-icon {
  width: 72px;
  height: 72px;
  color: #161613;
  animation: fpRotateNudge 2.4s ease-in-out infinite;
}
.fp-rotate-gate-title {
  margin: 0;
  font-family: "Copernicus", Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.02em;
}
.fp-rotate-gate-body {
  margin: 0;
  font-family: "American Grotesk", "Baloo 2", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  color: #4a4a45;
  max-width: 260px;
}
@keyframes fpRotateNudge {
  0%, 55%, 100% { transform: rotate(0deg); }
  65% { transform: rotate(-18deg); }
  75% { transform: rotate(12deg); }
  85% { transform: rotate(-6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .fp-rotate-gate-icon { animation: none; }
}
/* Phones / small tablets in landscape only — not desktop windows */
@media screen and (orientation: landscape) and (max-height: 520px) and (hover: none),
       screen and (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  .fp-rotate-gate {
    display: flex;
  }
  html:has(.fp-rotate-gate),
  body:has(.fp-rotate-gate) {
    overflow: hidden !important;
  }
}
