:root {
  color-scheme: light;
  /* Base palette approximating NYT Games hub (extracted from provided CSS) */
  --bg-page: #ffffff;
  --bg-page-subdued: #f4f4f4;
  --stroke-tertiary: #dfdfdf;
  --text-main: #121212;
  --text-muted: #727272;
  --accent-blue: #346eb7;

  /* Game-specific colors (from NYT games CSS) */
  --bg-games: #fbd300;
  --bg-mini: #95befa;
  --bg-wordle: #d3d6da;
  --bg-sb: #f7da21;
  --bg-connections: #b4a8ff;

  /* Icon URLs from NYT games assets (user-provided CSS) */
  --wordle-np: url("https://www.nytimes.com/games-assets/v2/assets/wordle/page-icons/Wordle-Icon-np.svg");
  --connections-np: url("https://www.nytimes.com/games-assets/v2/assets/wordle/page-icons/Connections-Icon-np.svg");
  --daily-np: url("https://www.nytimes.com/games-assets/v2/assets/wordle/page-icons/Crossword-Icon-np.svg");
  /* For Spelling Bee we use the local Laika bee image instead of the NYT logo */
  --spelling-bee-np: url("images/laika_bee.png");
  --mini-np: url("https://www.nytimes.com/games-assets/v2/assets/wordle/page-icons/Mini-Icon-np.svg");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.5;
  background: var(--bg-page-subdued);
  color: var(--text-main);
  font-family: "nyt-franklin", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

/* Top NYT-style nav */
.nyt-nav {
  height: 48px;
  border-bottom: 1px solid var(--stroke-tertiary);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 1.5rem;
  background: #ffffff;
}

.nyt-nav-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nyt-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 4px;
}

.nyt-logo-img {
  width: 44px;
  height: 44px;
  display: block;
}

.nyt-nav-title {
  font-family: "nyt-franklin", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero {
  padding: 2rem;
  border-bottom: 1px solid var(--stroke-tertiary);
  background: var(--bg-page-subdued);
}

.hero h1 {
  margin: 0.25rem 0;
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-family: "nyt-karnakcondensed", Georgia, "Times New Roman", serif;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hero .lede {
  max-width: 32rem;
  color: var(--text-muted);
}

.hero-nav {
  margin-top: 1.25rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-nav a {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Blue main picker section with 3 primary games */
.hub-welcome {
  background: #4d88f9;
  padding: 2rem 1.5rem 2.5rem;
}

.hub-welcome-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.hub-title {
  margin: 0 0 1.5rem;
  font-family: "nyt-stymie", system-ui, sans-serif;
  font-size: 1.25rem;
  text-align: center;
  color: #ffffff;
}

.hub-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* Slightly stronger shadow for featured cards on blue */
.hub-row .game-card {
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.25);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  border-top: 1px solid var(--stroke-tertiary);
}

/* Game grid layout for home cards */
.grid.games-grid {
  gap: 1.75rem;
  padding: 2.5rem 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto 3rem;
}

.game-card {
  background: #fff;
  border-radius: 0.5rem;
  border: 1px solid var(--stroke-tertiary);
  box-shadow: 0 7px 0 rgba(40, 96, 216, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.game-card-cover {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-card-cover--mini {
  background-color: var(--bg-mini);
}

.game-card-cover--wordle {
  background-color: var(--bg-wordle);
}

.game-card-cover--spelling-bee {
  background-color: var(--bg-sb);
}

.game-card-cover--connections {
  background-color: var(--bg-connections);
}

.game-card-cover--crossword {
  background-color: var(--bg-games);
}

.game-card-icon {
  width: 64px;
  height: 64px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.game-card-icon--mini {
  background-image: var(--mini-np);
}

.game-card-icon--wordle {
  background-image: var(--wordle-np);
}

.game-card-icon--spelling-bee {
  background-image: var(--spelling-bee-np);
}

.game-card-icon--connections {
  background-image: var(--connections-np);
}

.game-card-icon--crossword {
  background-image: var(--daily-np);
}

/* New card layout pieces for home grid */

.game-card-top {
  padding: 2rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  color: #000;
}

.game-card-top--wordle {
  background-color: var(--bg-wordle);
}

.game-card-top--mini {
  background-color: var(--bg-mini);
}

.game-card-top--connections {
  background-color: var(--bg-connections);
}

.game-card-top--spelling-bee {
  background-color: var(--bg-sb);
}

.game-card-top--crossword {
  background-color: var(--bg-games);
}

.game-title {
  margin: 0;
  font-family: "nyt-karnakcondensed", Georgia, "Times New Roman", serif;
  font-size: 1.9rem;
}

.game-card-bottom {
  background-color: #ffffff;
  padding: 1.5rem 1.5rem 1.75rem;
  border-top: 1px solid var(--stroke-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.game-desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
}

.game-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  align-items: center;
}

.pill {
  display: inline-block;
  min-width: 0;
  width: 100%;
  max-width: 260px;
  border-radius: 999px;
  border: 1px solid #dcdcdc;
  background-color: #ffffff;
  padding: 0.75rem 1.5rem;
  font-family: "nyt-franklin", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  color: var(--text-main);
  text-decoration: none;
}

.pill-secondary {
  background-color: #ffffff;
}

.pill:hover {
  background-color: #f4f4f4;
}

.cta {
  align-self: flex-start;
  border: 1px solid #000;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  margin: 0 1.25rem 1.25rem;
  background: #000;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: "nyt-franklin", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.cta:hover {
  background: #333;
  transform: translateY(1px);
}

.sidebar {
  margin: 0 2rem 2rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid var(--stroke-tertiary);
  max-width: 420px;
}

.sidebar h3 {
  margin-top: 0;
  font-family: "nyt-stymie", system-ui, sans-serif;
}

.sidebar-note {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}


/* iPuzzler section */
.ipuz-section {
  padding: 2.5rem 1.5rem 3rem;
  display: none;
}

.ipuz-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.ipuz-title {
  margin: 0 0 0.35rem;
  font-family: "nyt-karnakcondensed", Georgia, "Times New Roman", serif;
  font-size: 1.9rem;
}

.ipuz-lede {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

.ipuz-frame {
  background: #fff;
  border: 1px solid var(--stroke-tertiary);
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 7px 0 rgba(40, 96, 216, 0.12);
}

.ipuz-section.is-visible {
  display: block;
}

/* Crossword dedicated page */
.crossword-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.crossword-header {
  text-align: center;
  margin-bottom: 2rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--text-main);
}

.crossword-page-title {
  margin: 0 0 0.25rem;
  font-family: "nyt-karnakcondensed", Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
}

.crossword-page-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.crossword-container {
  background: #fff;
  border: 1px solid var(--stroke-tertiary);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (max-width: 640px) {
  .hero {
    padding: 1.5rem;
  }

  .grid {
    padding: 1.5rem 1.25rem;
  }

  .sidebar {
    margin: 0 1.25rem 1.5rem;
  }

  .crossword-page {
    padding: 1.5rem 1rem 2rem;
  }

  .crossword-page-title {
    font-size: 2rem;
  }

  .crossword-container {
    padding: 1rem;
  }
}

