/* ── SITE NAV (index + site pages) ──────────────────────────── */
.idx-nav {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 90px;
}

.logo-link {
  text-decoration: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Remove the stacked-column layout for the logo when it's inside a link
   (index header doesn't show a game-name label) */
.idx-nav .logo-wrap {
  flex-direction: row;
  gap: 0;
}

.main-nav {
  display: flex;
  gap: 2px;
  flex: 1;
  margin-left: 12px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: .18s;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: var(--btn-hover-bg);
}

/* ── HERO ────────────────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
  padding: 72px 20px 64px;
  text-align: center;
}

.hero-title {
  font-size: 2.6em;
  font-weight: 900;
  color: white;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
  line-height: 1.2;
}

.hero-sub {
  font-size: 17px;
  color: rgba(255,255,255,.82);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── MAIN WRAPPER ────────────────────────────────────────────── */
.idx-main { padding-bottom: 32px; }

/* ── GAMES SECTION ───────────────────────────────────────────── */
.games-section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 20px 0;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* ── GAME CARD ───────────────────────────────────────────────── */
.game-card-idx {
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(42,111,189,.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.game-card-idx:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(42,111,189,.22);
}

.game-card-visual {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sudoku-visual  { background: linear-gradient(135deg, #1d5296 0%, #4a9eff 100%); }
.mines-visual   { background: linear-gradient(135deg, #0e2040 0%, #1d5296 100%); }

/* ── MINI SUDOKU GRID ────────────────────────────────────────── */
.sudoku-preview {
  display: grid;
  grid-template-columns: repeat(9, 14px);
  border: 2px solid rgba(255,255,255,.55);
  border-radius: 3px;
  overflow: hidden;
}

.sp-cell {
  width: 14px;
  height: 14px;
  background: rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: rgba(255,255,255,.45);
  border-right:  1px solid rgba(255,255,255,.18);
  border-bottom: 1px solid rgba(255,255,255,.18);
  line-height: 1;
}
.sp-cell.sp-given  { background: rgba(255,255,255,.22); color: rgba(255,255,255,.95); }
.sp-cell.sp-br     { border-right:  2px solid rgba(255,255,255,.6); }
.sp-cell.sp-bb     { border-bottom: 2px solid rgba(255,255,255,.6); }
.sp-cell.sp-nr     { border-right:  none; }
.sp-cell.sp-nb     { border-bottom: none; }

.game-icon {
  font-size: 76px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.35));
}

.game-card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.game-card-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.2;
}

.game-card-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--info-text);
  margin-bottom: 16px;
  flex: 1;
}

.game-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.meta-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--best-bg);
  color: var(--primary);
  border: 1px solid var(--best-border);
  letter-spacing: .5px;
  text-transform: uppercase;
}

.play-btn {
  display: inline-block;
  padding: 11px 32px;
  background: var(--primary);
  color: white;
  border-radius: 26px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  align-self: flex-start;
  transition: .18s;
  letter-spacing: .3px;
}
.play-btn:hover {
  background: var(--primary-dk);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(42,111,189,.35);
}

/* ── SITE FOOTER ─────────────────────────────────────────────── */
.site-footer-main {
  background: var(--header-bg);
  border-top: 1px solid var(--border-light);
  margin-top: 64px;
  transition: background .25s;
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 20px 36px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.footer-brand a {
  display: inline-block;
  margin-bottom: 14px;
}

.footer-logo {
  height: 52px;
  width: auto;
}

.footer-brand p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 240px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--label-col);
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
  line-height: 1.5;
}
.footer-col a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding: 18px 20px;
  text-align: center;
}

.footer-bottom p {
  font-size: 12px;
  color: var(--muted);
  max-width: 1160px;
  margin: 0 auto;
}

/* ── ABOUT PAGE ──────────────────────────────────────────────── */
.about-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.about-lead {
  font-size: 17px;
  line-height: 1.8;
  color: var(--info-text);
  margin-bottom: 48px;
  max-width: 680px;
}

.about-section {
  margin-bottom: 52px;
}

.about-section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  padding-left: 14px;
  border-left: 4px solid var(--primary);
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 10px rgba(42,111,189,.07);
}

.feature-card-icon {
  font-size: 28px;
  margin-bottom: 12px;
  line-height: 1;
}

.feature-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.feature-card-desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--info-text);
}

.about-games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.about-game-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(42,111,189,.07);
  transition: transform .18s, box-shadow .18s;
}
.about-game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(42,111,189,.15);
}

.about-game-visual {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.about-game-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.about-game-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.about-game-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--info-text);
  flex: 1;
}

.about-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--info-text);
  margin-bottom: 14px;
}
.about-text:last-child { margin-bottom: 0; }

/* ── LEGAL PAGES ─────────────────────────────────────────────── */
.legal-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 36px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.legal-highlight {
  background: var(--best-bg);
  border: 1px solid var(--best-border);
  border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--info-text);
}

.about-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.about-text a:hover { text-decoration: underline; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { max-width: 100%; }
}

@media (max-width: 600px) {
  .hero-title { font-size: 1.9em; }
  .hero-sub   { font-size: 15px; }
  .games-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .idx-nav { height: 92px; gap: 6px; }
  .nav-link { padding: 7px 10px; font-size: 13px; }
  .about-games-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ── MEMORY SEQUENCE CARD PREVIEW ───────────────────────────── */
.ms-preview {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  grid-template-rows: repeat(3, 38px);
  gap: 5px;
  padding: 14px;
}

.ms-prev-pad {
  border-radius: 8px;
  opacity: 0.38;
}

.ms-prev-pad.ms-prev-lit {
  opacity: 1;
  box-shadow: 0 0 10px rgba(255,255,255,.35);
}

.ms-prev-center {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  font-size: 22px;
  opacity: 1;
}

/* ── MEMORY MATCH CARD PREVIEW ───────────────────────────────── */
.mc-preview {
  display: grid;
  grid-template-columns: repeat(4, 32px);
  grid-template-rows: repeat(4, 32px);
  gap: 4px;
  padding: 12px;
}

.mc-prev-card {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-size: 18px;
  background: rgba(255,255,255,.88);
}

.mc-prev-card.closed {
  background: rgba(42,111,189,.65);
  font-size: 12px;
  font-weight: 900;
  color: rgba(255,255,255,.5);
}

.mc-prev-card.closed::after { content: '?'; }

/* ── NUMBER MATCH CARD PREVIEW ───────────────────────────────── */
.nm-preview {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
}
.nm-prev-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(9px, 1.8vw, 13px);
  font-weight: 800;
  border-radius: 4px;
}

/* ── 2048 CARD PREVIEW ───────────────────────────────────────── */
.tg-preview {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 4px;
  padding: 10px;
}
.tg-prev-cell {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, .08);
}
.tg-prev-long { font-size: 9px; }

/* ── BLOCK FIT CARD PREVIEW ──────────────────────────────────── */
.bf-preview {
  display: grid;
  grid-template-columns: repeat(8, 16px);
  gap: 2px;
  padding: 10px;
}
.bf-prev-cell {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .07);
}
.bf-prev-fill {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35),
              inset 0 -1px 0 rgba(0, 0, 0, .2);
}
