:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #1d2430;
  --muted: #67707e;
  --line: #e6eaf0;
  --brand: #2f6df6;
  --brand-dark: #1f55cc;
  --accent: #16a34a;
  --tile: #eef3ff;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 880px; margin: 0 auto; padding: 0 18px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  max-width: 1140px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  padding-top: 14px; padding-bottom: 14px;
}
.logo { font-size: 20px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); white-space: nowrap; }
.logo span { color: var(--brand); }
/* Nav is collapsed behind the hamburger at every screen size. */
.nav {
  display: none;
  flex-basis: 100%;
  flex-direction: column;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}
.nav.open { display: flex; }
.nav a {
  color: var(--muted); font-weight: 600; white-space: nowrap;
  margin-left: 0;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.nav a:last-child { border-bottom: none; }
.nav a:hover { color: var(--ink); text-decoration: none; }

/* Hamburger toggle (shown at all widths) */
.nav-toggle {
  display: block; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 10px; margin: -6px 0;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px; margin: 5px auto;
  background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero / tool */
.hero { padding: 34px 0 10px; text-align: center; }
.hero h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.5px; }
.hero p.sub { color: var(--muted); margin: 0 auto 22px; max-width: 560px; }

.tool {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.tool .controls { display: flex; gap: 10px; flex-wrap: wrap; }
.tool input[type="text"] {
  flex: 1 1 260px;
  font-size: 20px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: none;
  text-transform: lowercase;
}
.tool input[type="text"]:focus { border-color: var(--brand); }
.btn {
  font-size: 16px; font-weight: 700;
  padding: 14px 22px; border-radius: 12px;
  border: none; cursor: pointer;
  background: var(--brand); color: #fff;
  transition: background .15s ease;
}
.btn:hover { background: var(--brand-dark); }
.opts { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: 14px; align-items: center; }
.opts label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.opts select, .opts input[type="number"] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }

/* Status + results */
.status { color: var(--muted); font-size: 14px; margin: 14px 2px; min-height: 20px; }
.results-group { margin-top: 18px; }
.results-group h3 {
  font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px;
  margin: 0 0 10px; border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.tile {
  background: var(--tile);
  border: 1px solid #dde6fb;
  border-radius: 10px;
  padding: 7px 11px;
  font-weight: 600;
  display: inline-flex; align-items: baseline; gap: 7px;
}
.tile .score {
  font-size: 12px; font-weight: 700; color: #fff;
  background: var(--brand); border-radius: 6px; padding: 1px 6px;
}
.tile a { color: inherit; }
a.tile { color: var(--ink); transition: border-color .15s ease, transform .05s ease; }
a.tile:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.alpha-strip a.tile, .alpha-strip span.tile {
  min-width: 34px; justify-content: center; font-weight: 700; padding: 8px 10px;
}

/* Wordle solver controls */
.field {
  display: block; text-align: left; margin: 14px 0;
}
.field > label {
  display: block; font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px;
}
.field .hint { font-weight: 600; color: #9aa3b1; text-transform: none; letter-spacing: 0; }
.wordle-grid { display: flex; gap: 8px; }
.wbox {
  width: 52px; height: 56px; text-align: center;
  font-size: 26px; font-weight: 800; text-transform: lowercase;
  border: 2px solid var(--line); border-radius: 10px; outline: none;
  background: #eafbe9; color: var(--ink);
}
.wbox:focus { border-color: var(--accent); }
.field input.line {
  width: 100%; font-size: 18px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 10px; outline: none; text-transform: lowercase;
}
.field input.line:focus { border-color: var(--brand); }
.field.yellow input.line { background: #fffbe6; }
.field.gray input.line { background: #f1f3f6; }

/* Share bar */
.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; }
.share-bar .share-label { font-weight: 700; color: var(--muted); margin-right: 2px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; line-height: 1;
  padding: 9px 14px; border-radius: 999px;
  border: none; cursor: pointer; color: #fff; text-decoration: none;
  transition: opacity .15s ease, transform .05s ease;
}
.share-btn:hover { opacity: .9; text-decoration: none; }
.share-btn:active { transform: translateY(1px); }
.share-btn svg { width: 16px; height: 16px; fill: currentColor; }
.s-x { background: #000; }
.s-facebook { background: #1877f2; }
.s-whatsapp { background: #25d366; }
.s-reddit { background: #ff4500; }
.s-email { background: #6b7280; }
.s-copy { background: var(--brand); }

/* Ad slots */
.ad-slot {
  margin: 22px 0; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); border-radius: 12px;
  color: #aab2bf; font-size: 12px; background: #fbfcfe;
}
/* Hide ad slots entirely until a slot ID is configured. Once config.js has a
   slot ID, the loader injects an <ins> so the box is no longer :empty and shows. */
.ad-slot:empty { display: none; }

/* Content / SEO blocks */
.content { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 22px 0; box-shadow: var(--shadow); }
.content h2 { font-size: 22px; margin: 0 0 10px; letter-spacing: -.3px; }
.content h3 { font-size: 17px; margin: 20px 0 8px; }
.content p { color: #38414f; }
.pill-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pill-links a { background: var(--tile); border: 1px solid #dde6fb; border-radius: 999px; padding: 6px 13px; font-size: 14px; font-weight: 600; }

.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: #38414f; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--card); margin-top: 30px; }
.site-footer .container { padding: 26px 18px; color: var(--muted); font-size: 14px; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.site-footer h4 { color: var(--ink); font-size: 14px; margin: 0 0 8px; }
.site-footer a { display: block; color: var(--muted); margin: 4px 0; }
.site-footer .copyright { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }

@media (max-width: 600px) {
  .hero h1 { font-size: 24px; }
}

/* Breadcrumb (games section) */
.breadcrumb { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { color: #c2c9d4; margin: 0 6px; }

/* Shared daily-streak / stats strip */
.wso-stats { display: flex; gap: 10px; justify-content: center; margin: 14px 0 4px; flex-wrap: wrap; }
.wso-stat {
  flex: 0 1 130px; text-align: center; background: var(--tile);
  border: 1px solid #dde6fb; border-radius: 12px; padding: 10px 8px;
}
.wso-stat-num { display: block; font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.wso-stat-lab { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }

/* Games hub cards */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 18px 0; }
.game-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  transition: transform .1s ease, border-color .15s ease;
}
.game-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.game-card h3 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.game-card p { margin: 0; color: #38414f; font-size: 14px; }
.game-card .game-emoji { font-size: 30px; display: block; margin-bottom: 8px; }

/* Ladder rungs (daily anagram) */
.ladder { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 16px; }
.rung {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--tile);
  transition: border-color .15s ease, background .15s ease;
}
.rung.active { border-color: var(--brand); background: #eef4ff; }
.rung.done { border-color: var(--accent); background: #eafaf1; }
.rung.locked { opacity: .55; }
.rung-scramble { font-size: 24px; font-weight: 800; letter-spacing: 6px; text-transform: uppercase; color: var(--ink); flex: 1; }
.rung.done .rung-scramble { letter-spacing: 2px; color: var(--accent); }
.rung-len { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 62px; text-transform: uppercase; letter-spacing: .4px; }
.rung-mark { font-size: 20px; min-width: 24px; text-align: center; }

/* ---- Cookie consent bar ---- */
.wso-consent {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9999;
  max-width: 920px; margin: 0 auto; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.wso-consent-text { margin: 0; font-size: 14px; line-height: 1.5; flex: 1 1 320px; color: var(--muted); }
.wso-consent-text a { color: var(--brand); }
.wso-consent-btns { display: flex; gap: 8px; flex: 0 0 auto; margin-left: auto; }
.wso-consent-btn {
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  border-radius: 10px; padding: 9px 18px; border: 1px solid transparent;
}
.wso-consent-btn.primary { background: var(--brand); color: #fff; }
.wso-consent-btn.primary:hover { background: var(--brand-dark); }
.wso-consent-btn.ghost { background: #eef1f6; color: var(--ink); border-color: var(--line); }
.wso-consent-btn.ghost:hover { background: #e2e7ef; }
@media (max-width: 520px) {
  .wso-consent { flex-direction: column; align-items: stretch; }
  .wso-consent-btns { margin-left: 0; }
  .wso-consent-btn { flex: 1 1 0; }
}

/* Homepage games banner strip */
.games-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 10px; padding: 12px 16px; border-radius: 12px;
  background: linear-gradient(90deg, #2f6df6 0%, #1f55cc 100%);
  color: #fff; text-decoration: none;
}
.games-banner:hover { filter: brightness(1.05); }
.games-banner .gb-badge {
  background: #ffd43b; color: #1d2430; font-weight: 800; font-size: 12px;
  letter-spacing: .5px; padding: 3px 8px; border-radius: 999px; text-transform: uppercase;
}
.games-banner .gb-main { flex: 1 1 auto; font-size: 15px; color: #fff; }
.games-banner .gb-main strong { color: #fff; }
.games-banner .gb-cta { font-weight: 800; white-space: nowrap; color: #fff; }
.games-strip {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px;
}
.games-strip a {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid #dce2ec; border-radius: 999px;
  padding: 6px 13px; font-weight: 700; font-size: 14px; color: var(--ink);
}
.games-strip a:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 520px) {
  .games-banner .gb-main { font-size: 14px; flex-basis: 100%; order: 3; }
}
