/* =============================================================================
   Web Directory Template — Global Stylesheet
   Design System: Deep Navy + Electric Blue + Emerald Green
   Edit the :root color tokens below to rebrand. Powers the home, category,
   entry, comparison, guide, blog, books, links and videos page templates.
   ============================================================================= */

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--blue-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.4em; }

/* --- COLOR TOKENS --- */
:root {
  --navy:         #0d1b2e;
  --slate:        #1e3a5f;
  --blue:         #2563eb;
  --blue-dark:    #1d4ed8;
  --blue-light:   #3b82f6;
  --blue-pale:    #eff6ff;
  --green:        #059669;
  --green-dark:   #047857;
  --green-light:  #d1fae5;
  --amber:        #d97706;
  --amber-light:  #fef3c7;
  --red:          #dc2626;
  --red-light:    #fee2e2;
  --bg:           #f8faff;
  --card:         #ffffff;
  --text:         #0f172a;
  --muted:        #64748b;
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;
  --ad-bg:        #f1f5f9;
  --gold:         #b45309;
}

/* --- SKIP LINK --- */
.skip-link {
  position: absolute; top: -60px; left: 16px; z-index: 9999;
  background: var(--navy); color: #fff; padding: 10px 18px;
  border-radius: 0 0 6px 6px; font-size: 0.85rem; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* =============================================================================
   HEADER + NAV
   ============================================================================= */
header {
  background: var(--navy);
  position: sticky; top: 0; z-index: 500;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 24px;
}
.site-title a {
  color: #fff; font-size: 1.35rem; font-weight: 800;
  letter-spacing: -0.3px; text-decoration: none;
}
.site-title a span { color: var(--blue-light); }
.site-tagline { color: rgba(255,255,255,0.45); font-size: 0.72rem; margin-top: 1px; }

header nav ul {
  display: flex; align-items: center; gap: 4px;
  list-style: none; padding: 0; margin: 0;
}
header nav ul li a {
  color: rgba(255,255,255,0.82); font-size: 0.88rem; font-weight: 500;
  padding: 8px 11px; border-radius: 6px;
  text-decoration: none; transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
header nav ul li a:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
header nav ul li a[aria-current="page"] { background: rgba(37,99,235,0.3); color: #fff; }
.nav-cta {
  background: var(--blue) !important; color: #fff !important;
  padding: 8px 16px !important; border-radius: 6px !important;
  font-weight: 700 !important; font-size: 0.85rem !important;
}
.nav-cta:hover { background: var(--blue-dark) !important; }

/* Hamburger */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 6px; color: #fff;
}
.nav-toggle .icon-close { display: none; }
header nav.open .icon-open { display: none; }
header nav.open .icon-close { display: block; }
header nav.open ul {
  display: flex; flex-direction: column; align-items: stretch;
  position: absolute; top: 64px; left: 0; right: 0;
  background: var(--navy); padding: 12px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* =============================================================================
   AD SLOTS
   ============================================================================= */
.ad-leaderboard {
  background: var(--ad-bg); border-bottom: 1px solid var(--border);
  padding: 10px 20px; text-align: center;
}
.ad-slot-728 {
  display: inline-flex; align-items: center; justify-content: center;
  width: 728px; max-width: 100%; height: 90px;
  background: var(--border); color: var(--muted);
  font-size: 0.78rem; border-radius: 4px; border: 1px dashed var(--border-strong);
}
.ad-slot-300x250 {
  width: 300px; max-width: 100%; height: 250px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ad-bg); border: 1px dashed var(--border-strong);
  color: var(--muted); font-size: 0.78rem; border-radius: 6px;
}
.ad-slot-300x600 {
  width: 300px; max-width: 100%; height: 600px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ad-bg); border: 1px dashed var(--border-strong);
  color: var(--muted); font-size: 0.78rem; border-radius: 6px;
}
.ad-slot-468 {
  width: 468px; max-width: 100%; height: 60px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ad-bg); border: 1px dashed var(--border-strong);
  color: var(--muted); font-size: 0.78rem; border-radius: 4px;
}
.ad-label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.ad-box { margin-bottom: 20px; }
.in-content-ad { text-align: center; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 28px 0; }

/* =============================================================================
   AFFILIATE DISCLOSURE BAR
   ============================================================================= */
/* Unobtrusive affiliate disclosure that lives in the footer (replaces the old
   top-of-page banner so it never competes with the menu). */
.footer-disclosure {
  max-width: 1100px; margin: 0 auto; padding: 16px 20px 0;
  font-size: 0.76rem; line-height: 1.55; color: rgba(255,255,255,0.5); text-align: center;
}
.footer-disclosure a { color: rgba(255,255,255,0.8); text-decoration: underline; }

/* =============================================================================
   LAYOUT — Page Wrapper & Sidebar
   ============================================================================= */
.page-wrap {
  max-width: 1200px; margin: 0 auto; padding: 28px 20px 48px;
  display: grid; grid-template-columns: 1fr 300px; gap: 32px;
}
.page-wrap.full-width { grid-template-columns: 1fr; max-width: 900px; }
.page-wrap.wide { grid-template-columns: 1fr; max-width: 1200px; }
main { min-width: 0; }
aside { min-width: 0; }

/* =============================================================================
   BREADCRUMB
   ============================================================================= */
.breadcrumb {
  font-size: 0.82rem; color: var(--muted); margin-bottom: 18px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb span { margin: 0 6px; }

/* =============================================================================
   HERO
   ============================================================================= */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--slate) 100%);
  color: #fff; padding: 56px 0 48px; margin-bottom: 0;
}
.hero-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hero h1 { font-size: 2.2rem; font-weight: 900; line-height: 1.15; margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--blue-light); }
.hero .subtitle { font-size: 1.1rem; color: rgba(255,255,255,0.75); max-width: 580px; margin-bottom: 28px; }
.hero-stats {
  display: flex; gap: 32px; flex-wrap: wrap; margin-top: 28px;
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.12);
}
.hero-stat-val { font-size: 1.6rem; font-weight: 800; color: var(--blue-light); }
.hero-stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.55); margin-top: 2px; }
.hero-search {
  display: flex; gap: 10px; margin-top: 20px; max-width: 520px;
}
.hero-search input {
  flex: 1; padding: 12px 16px; border: 2px solid rgba(255,255,255,0.2);
  border-radius: 8px; font-size: 0.95rem; background: rgba(255,255,255,0.08);
  color: #fff; outline: none;
}
.hero-search input::placeholder { color: rgba(255,255,255,0.4); }
.hero-search input:focus { border-color: var(--blue-light); }
.hero-search button {
  padding: 12px 20px; background: var(--blue); color: #fff; border: none;
  border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 0.95rem;
  transition: background 0.15s;
}
.hero-search button:hover { background: var(--blue-dark); }

/* =============================================================================
   SECTION TITLES
   ============================================================================= */
.section-title {
  font-size: 1.4rem; font-weight: 800; color: var(--navy);
  margin: 28px 0 6px; padding-bottom: 10px;
  border-bottom: 3px solid var(--blue); display: inline-block;
}
.section-lead { color: var(--muted); font-size: 0.95rem; margin-bottom: 20px; }

/* =============================================================================
   TOOL CARDS
   ============================================================================= */
.tool-grid { display: grid; gap: 20px; }
.tool-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.tool-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.tool-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px; transition: box-shadow 0.2s, transform 0.15s;
  position: relative; display: flex; flex-direction: column; gap: 14px;
}
.tool-card:hover { box-shadow: 0 4px 24px rgba(37,99,235,0.1); transform: translateY(-2px); }
.tool-card.featured {
  border-color: var(--blue); border-width: 2px;
}
.tool-card.featured::before {
  content: "Top Pick"; position: absolute; top: -1px; right: 16px;
  background: var(--blue); color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 3px 10px; border-radius: 0 0 6px 6px; letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tool-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tool-name { font-size: 1.15rem; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.tool-category { font-size: 0.75rem; color: var(--blue); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.score-badge {
  flex-shrink: 0; width: 54px; height: 54px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 900;
}
.score-badge .score-num { font-size: 1.3rem; line-height: 1; }
.score-badge .score-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; opacity: 0.8; }
.score-badge.green { background: var(--green-light); color: var(--green-dark); }
.score-badge.blue  { background: var(--blue-pale); color: var(--blue-dark); }
.score-badge.amber { background: var(--amber-light); color: var(--amber); }

.tool-summary { font-size: 0.9rem; color: var(--muted); line-height: 1.65; }

.tool-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.meta-item { display: flex; flex-direction: column; min-width: 80px; }
.meta-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.meta-val { font-size: 0.88rem; color: var(--text); font-weight: 600; margin-top: 1px; }

.best-for {
  background: var(--blue-pale); border-radius: 6px; padding: 8px 12px;
  font-size: 0.82rem; color: var(--slate);
}
.best-for strong { color: var(--navy); }

.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pros, .cons { font-size: 0.82rem; }
.pros h4 { color: var(--green-dark); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.cons h4 { color: var(--red); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.pros ul, .cons ul { padding-left: 1.1em; }
.pros li { color: var(--green-dark); margin-bottom: 3px; }
.pros li::marker { content: "✓  "; }
.cons li { color: var(--red); margin-bottom: 3px; }
.cons li::marker { content: "✕  "; }

.tool-footer { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; border-top: 1px solid var(--border); }

/* =============================================================================
   BADGES / CHIPS
   ============================================================================= */
.badge {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-blue   { background: var(--blue-pale); color: var(--blue-dark); }
.badge-green  { background: var(--green-light); color: var(--green-dark); }
.badge-amber  { background: var(--amber-light); color: var(--amber); }
.badge-navy   { background: rgba(13,27,46,0.08); color: var(--navy); }
.badge-top    { background: var(--blue); color: #fff; }

.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* =============================================================================
   BUTTONS
   ============================================================================= */
.cta-btn {
  display: inline-block; background: var(--blue); color: #fff !important;
  padding: 9px 18px; border-radius: 7px; font-weight: 700; font-size: 0.88rem;
  text-decoration: none !important; transition: background 0.15s, transform 0.1s;
  border: none; cursor: pointer;
}
.cta-btn:hover { background: var(--blue-dark) !important; transform: translateY(-1px); }
.cta-btn.green-btn { background: var(--green); }
.cta-btn.green-btn:hover { background: var(--green-dark) !important; }
.cta-btn-lg { padding: 13px 28px; font-size: 1rem; border-radius: 8px; }
.cta-btn-outline {
  display: inline-block; background: transparent; color: var(--blue) !important;
  padding: 8px 16px; border-radius: 7px; font-weight: 700; font-size: 0.88rem;
  border: 2px solid var(--blue); text-decoration: none !important;
  transition: background 0.15s;
}
.cta-btn-outline:hover { background: var(--blue-pale) !important; }
.affiliate-link::after { content: " ↗"; font-size: 0.8em; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* =============================================================================
   CONTENT CARDS
   ============================================================================= */
.content-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 24px; margin-bottom: 20px;
}
.content-card h2 { font-size: 1.2rem; color: var(--navy); margin-bottom: 12px; }
.content-card h3 { font-size: 1rem; color: var(--navy); margin-bottom: 8px; }
.content-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.7; margin-bottom: 10px; }
.content-card ul, .content-card ol { font-size: 0.9rem; color: var(--muted); line-height: 1.7; }
.content-card li { margin-bottom: 5px; }

/* =============================================================================
   ARTICLE HEADER
   ============================================================================= */
.article-header { margin-bottom: 24px; }
.article-header h1 { font-size: 1.9rem; font-weight: 900; color: var(--navy); line-height: 1.2; margin-bottom: 10px; }
.article-header .subtitle { font-size: 1rem; color: var(--muted); margin-bottom: 12px; }
.article-meta { font-size: 0.8rem; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.article-meta span::before { margin-right: 4px; }

/* =============================================================================
   COMPARISON TABLE
   ============================================================================= */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 20px; }
.comparison-table {
  width: 100%; min-width: 600px; border-collapse: collapse;
  font-size: 0.88rem;
}
.comparison-table th {
  background: var(--navy); color: #fff; padding: 11px 14px;
  text-align: left; font-size: 0.82rem; font-weight: 700;
  white-space: nowrap;
}
.comparison-table th:first-child { border-radius: 8px 0 0 0; }
.comparison-table th:last-child  { border-radius: 0 8px 0 0; }
.comparison-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--text);
}
.comparison-table tr:hover td { background: var(--blue-pale); }
.comparison-table .check { color: var(--green); font-weight: 700; }
.comparison-table .cross { color: var(--red); }
.comparison-table .highlight td { background: #eff6ff; font-weight: 600; }
.comparison-table .tool-col { font-weight: 700; color: var(--navy); }

/* =============================================================================
   CATEGORY GRID / CARDS
   ============================================================================= */
.category-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px;
}
.category-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; transition: box-shadow 0.2s, border-color 0.15s;
  text-decoration: none !important; display: block;
}
.category-card:hover { box-shadow: 0 4px 20px rgba(37,99,235,0.1); border-color: var(--blue); text-decoration: none; }
.cat-icon { font-size: 1.8rem; margin-bottom: 10px; }
.cat-name { font-size: 1rem; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.cat-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.cat-count { font-size: 0.75rem; color: var(--blue); font-weight: 700; margin-top: 8px; }

/* =============================================================================
   GUIDE / ARTICLE CARDS
   ============================================================================= */
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.guide-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; text-decoration: none !important;
  display: block; transition: box-shadow 0.15s;
}
.guide-card:hover { box-shadow: 0 3px 16px rgba(0,0,0,0.08); text-decoration: none; }
.guide-cat { font-size: 0.72rem; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.guide-title { font-size: 0.95rem; font-weight: 700; color: var(--navy); line-height: 1.4; margin-bottom: 6px; }
.guide-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

/* =============================================================================
   VERDICT BOX
   ============================================================================= */
.verdict-box {
  background: var(--blue-pale); border: 2px solid var(--blue-light);
  border-radius: 10px; padding: 20px 22px; margin: 20px 0;
}
.verdict-box .verdict-label { font-size: 0.72rem; font-weight: 800; color: var(--blue); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.verdict-box p { font-size: 0.92rem; color: var(--navy); font-weight: 500; margin: 0; line-height: 1.6; }

/* =============================================================================
   CTA BANNER
   ============================================================================= */
.cta-banner {
  background: linear-gradient(135deg, var(--navy), var(--slate));
  border-radius: 12px; padding: 32px 28px; text-align: center; margin: 28px 0;
  color: #fff;
}
.cta-banner h2 { font-size: 1.35rem; margin-bottom: 8px; }
.cta-banner p { color: rgba(255,255,255,0.7); font-size: 0.9rem; margin-bottom: 20px; }

/* =============================================================================
   CALLOUT / ALERT BOXES
   ============================================================================= */
.callout-box {
  border-left: 4px solid var(--blue); background: var(--blue-pale);
  border-radius: 0 8px 8px 0; padding: 14px 18px; font-size: 0.9rem;
  color: var(--navy); margin: 16px 0;
}
.callout-box.green { border-color: var(--green); background: var(--green-light); color: #064e3b; }
.callout-box.amber { border-color: var(--amber); background: var(--amber-light); color: #78350f; }
.pullquote {
  border-left: 4px solid var(--blue-light); padding: 14px 20px; margin: 20px 0;
  font-size: 1.05rem; font-style: italic; color: var(--slate); background: var(--blue-pale);
  border-radius: 0 8px 8px 0;
}

/* =============================================================================
   FAQ SECTION
   ============================================================================= */
.faq-section { margin-top: 24px; }
.faq-section h2 { font-size: 1.2rem; color: var(--navy); margin-bottom: 14px; }
details {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 10px; overflow: hidden;
}
summary {
  padding: 14px 18px; font-weight: 700; font-size: 0.92rem; color: var(--navy);
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; color: var(--blue); transition: transform 0.2s; }
details[open] summary::after { content: "−"; }
details[open] summary { border-bottom: 1px solid var(--border); }
.faq-answer { padding: 14px 18px; font-size: 0.88rem; color: var(--muted); line-height: 1.7; }

/* =============================================================================
   SIDEBAR COMPONENTS
   ============================================================================= */
.sidebar-widget {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px; margin-bottom: 20px;
}
.sidebar-widget h4 { font-size: 0.9rem; color: var(--navy); font-weight: 700; margin-bottom: 12px; border-bottom: 2px solid var(--blue); padding-bottom: 8px; }
.sidebar-links { list-style: none; padding: 0; }
.sidebar-links li { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.sidebar-links li:last-child { border-bottom: none; }

/* Newsletter / lead capture */
.sidebar-cta {
  background: linear-gradient(135deg, var(--navy), var(--slate));
  border-radius: 10px; padding: 20px; color: #fff; margin-bottom: 20px;
}
.sidebar-cta h4 { font-size: 0.95rem; color: #fff; margin-bottom: 6px; }
.sidebar-cta p { font-size: 0.8rem; color: rgba(255,255,255,0.65); margin-bottom: 14px; }
.sidebar-cta input[type="email"] {
  width: 100%; padding: 9px 12px; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px; font-size: 0.88rem; background: rgba(255,255,255,0.1);
  color: #fff; margin-bottom: 8px; outline: none;
}
.sidebar-cta input::placeholder { color: rgba(255,255,255,0.4); }

/* Top tools list */
.top-tools-list { list-style: none; padding: 0; }
.top-tools-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.top-tools-list li:last-child { border-bottom: none; }
.rank-num { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 0.7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-link { font-weight: 600; color: var(--text); flex: 1; }
.tool-score-sm { font-size: 0.78rem; font-weight: 700; color: var(--green-dark); }

/* =============================================================================
   ARTICLE BODY
   ============================================================================= */
.article-body h2 { font-size: 1.2rem; font-weight: 800; color: var(--navy); margin: 28px 0 10px; }
.article-body h3 { font-size: 1rem; font-weight: 700; color: var(--slate); margin: 20px 0 8px; }
.article-body p { font-size: 0.92rem; color: var(--text); line-height: 1.75; margin-bottom: 14px; }
.article-body ul, .article-body ol { font-size: 0.92rem; color: var(--text); line-height: 1.75; margin-bottom: 14px; }
.article-body li { margin-bottom: 5px; }
.article-body a { color: var(--blue); text-decoration: underline; }
.article-body strong { color: var(--navy); }

/* =============================================================================
   FORMS
   ============================================================================= */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 0.92rem; color: var(--text);
  background: #fff; font-family: inherit; transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-group textarea { min-height: 130px; resize: vertical; }
.form-group .hint { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.honeypot { display: none; }
.submit-btn {
  display: inline-block; background: var(--blue); color: #fff;
  padding: 12px 28px; border-radius: 7px; font-weight: 700; font-size: 0.95rem;
  border: none; cursor: pointer; transition: background 0.15s;
}
.submit-btn:hover { background: var(--blue-dark); }
.success-msg {
  display: none; background: var(--green-light); border: 1px solid #6ee7b7;
  color: var(--green-dark); border-radius: 7px; padding: 14px 18px; margin-bottom: 16px; font-size: 0.9rem;
}

/* =============================================================================
   FOOTER
   ============================================================================= */
footer {
  background: var(--navy); color: rgba(255,255,255,0.7); font-size: 0.85rem;
  margin-top: 48px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 40px 20px 28px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
}
.footer-inner h4 { color: #fff; font-size: 0.88rem; font-weight: 700; margin-bottom: 12px; }
.footer-inner a { color: rgba(255,255,255,0.6); text-decoration: none; }
.footer-inner a:hover { color: #fff; }
.footer-inner ul { list-style: none; padding: 0; }
.footer-inner ul li { margin-bottom: 7px; }
.footer-bottom {
  text-align: center; padding: 14px 20px; font-size: 0.78rem; color: rgba(255,255,255,0.35);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 960px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .nav-toggle { display: block; }
  header nav ul { display: none; }
  .page-wrap { grid-template-columns: 1fr; padding: 16px 14px 40px; }
  .hero h1 { font-size: 1.5rem; }
  .hero { padding: 32px 0 28px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .category-grid { grid-template-columns: 1fr; }
  .tool-grid.cols-2, .tool-grid.cols-3 { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .pros-cons { grid-template-columns: 1fr; }
  .hero-stats { gap: 16px; }
  .article-header h1 { font-size: 1.4rem; }
}

/* =============================================================================
   UTILITIES
   ============================================================================= */
.disclaimer { font-size: 0.78rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 24px; line-height: 1.6; }
.orgs-list { list-style: none; padding: 0; }
.orgs-list li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; color: var(--muted); line-height: 1.6; }
.orgs-list li:last-child { border-bottom: none; }
.orgs-list strong { color: var(--navy); display: block; margin-bottom: 2px; }
.updated-note { font-size: 0.75rem; color: var(--muted); font-style: italic; }
.text-green { color: var(--green-dark); }
.text-blue  { color: var(--blue); }
.text-amber { color: var(--amber); }
.text-red   { color: var(--red); }
.fw-700 { font-weight: 700; }

/* Related-links box (entry/review pages) */
.related-links { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; margin: 24px 0; }
.related-links h3 { font-size: 1rem; color: var(--navy); margin-bottom: 10px; }
.related-links ul { padding-left: 1.1em; }
.related-links li { margin-bottom: 4px; font-size: 0.9rem; }

/* =============================================================================
   PRINT
   ============================================================================= */
@media print {
  header, footer, .ad-leaderboard, .ad-box, aside, .cta-banner, .disclosure-bar { display: none; }
  .page-wrap { grid-template-columns: 1fr; }
  a::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
}

/* =============================================================================
   PRINTABLE DEBT-FREE PLAN  (resources/debt-free-plan.html)
   A fill-in worksheet: type on screen or print blank. Print styles are scoped
   to body.plan-page so they never affect other pages.
   ============================================================================= */
.plan-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--blue-pale); border: 1px solid var(--blue-light); border-radius: 10px; padding: 14px 18px; margin-bottom: 20px; }
.plan-toolbar p { font-size: 0.88rem; color: var(--navy); margin: 0; }
.btn-print { background: var(--blue); color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-size: 0.9rem; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn-print:hover { background: #1d4ed8; }

.plan-sheet { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 30px 32px; box-shadow: 0 1px 3px rgba(13,27,46,0.04); }
.plan-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; border-bottom: 3px solid var(--navy); padding-bottom: 12px; margin-bottom: 16px; }
.plan-head h1 { font-size: 1.7rem; color: var(--navy); margin: 0; line-height: 1.1; }
.plan-head .plan-brand { font-size: 0.8rem; color: var(--blue); font-weight: 700; }
.plan-head .plan-date { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

.plan-section { margin: 16px 0; }
.plan-section h2 { font-size: 0.95rem; color: var(--navy); text-transform: uppercase; letter-spacing: 0.05em; border-left: 4px solid var(--blue); padding-left: 10px; margin-bottom: 10px; }
.plan-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
@media (max-width: 560px) { .plan-row { grid-template-columns: 1fr; } }
.plan-field label { display: block; font-size: 0.74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.plan-input { width: 100%; border: none; border-bottom: 1.5px solid #94a3b8; background: transparent; font-family: inherit; font-size: 1rem; color: var(--navy); padding: 6px 2px; }
.plan-input:focus { outline: none; border-bottom-color: var(--blue); }
.plan-input.big { font-size: 1.2rem; font-weight: 700; }
textarea.plan-input { border: 1.5px solid #94a3b8; border-radius: 6px; min-height: 46px; resize: vertical; }

.plan-table { width: 100%; border-collapse: collapse; }
.plan-table th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); text-align: left; padding: 0 8px 6px; }
.plan-table td { padding: 2px 8px; }
.plan-table input { width: 100%; border: none; border-bottom: 1px solid #cbd5e1; background: transparent; font-family: inherit; font-size: 0.95rem; padding: 7px 2px; color: var(--navy); }
.plan-table input:focus { outline: none; border-bottom-color: var(--blue); }

.plan-choice { display: flex; gap: 20px; flex-wrap: wrap; font-size: 0.95rem; color: var(--text); }
.plan-choice label, .plan-check label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.plan-check { display: flex; flex-direction: column; gap: 7px; font-size: 0.95rem; color: var(--text); }
.plan-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; margin-top: 8px; }
.plan-months span { border: 1.5px solid #94a3b8; border-radius: 5px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 0.68rem; color: var(--muted); }
@media (max-width: 560px) { .plan-months { grid-template-columns: repeat(6, 1fr); } }
.plan-foot { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 12px; font-size: 0.78rem; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plan-foot strong { color: var(--blue); }

@media print {
  body.plan-page .no-print, body.plan-page .breadcrumb { display: none !important; }
  body.plan-page a::after { content: none !important; }
  body.plan-page .page-wrap { padding: 0; max-width: none; }
  body.plan-page .plan-sheet { border: none; box-shadow: none; border-radius: 0; padding: 0; }
  body.plan-page { font-size: 12px; }
  body.plan-page .plan-input, body.plan-page .plan-table input, body.plan-page textarea.plan-input { border-color: #888 !important; }
  @page { margin: 1.4cm; }
}

/* =============================================================================
   AD PLACEMENTS
   These containers held placeholder "Ad — NxN" boxes and manual <ins> units with
   placeholder slot IDs (not real ad units). They are hidden so the live site never
   shows fake/empty ad boxes. Ads are served by AdSense Auto Ads via the loader
   script in each page <head>. To use manual units later: create real ad units in
   AdSense, replace the placeholders, and remove the relevant selector below.
   ============================================================================= */
.ad-leaderboard, .in-content-ad, .ad-incontent, .ad-box { display: none !important; }

/* =============================================================================
   VIDEO EMBED (used by the videos page template)
   Responsive 16:9 wrapper for YouTube/Vimeo iframes.
   ============================================================================= */
.video-embed { position: relative; width: 100%; padding-top: 56.25%; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #000; margin-bottom: 8px; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* =============================================================================
   CALCULATOR WIDGETS  (Debt Free Hub)
   Shared styles for the interactive calculator tools.
   ============================================================================= */
.calc-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(13,27,46,0.04);
}
.calc-card h2 { font-size: 1.15rem; color: var(--navy); margin-bottom: 4px; }
.calc-card .calc-intro { font-size: 0.88rem; color: var(--muted); margin-bottom: 18px; }
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 680px) { .calc-grid { grid-template-columns: 1fr; } }
.input-prefix { position: relative; }
.input-prefix span {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 0.9rem; pointer-events: none;
}
.input-prefix input { padding-left: 26px !important; }
.calc-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Error + result panels */
.calc-error {
  display: none; background: var(--red-light); border: 1px solid #fca5a5;
  color: #991b1b; border-radius: 8px; padding: 12px 16px; font-size: 0.86rem;
  margin-top: 16px; line-height: 1.55;
}
.calc-result {
  display: none; margin-top: 22px; border-top: 2px solid var(--border); padding-top: 22px;
}
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 680px) { .result-stats { grid-template-columns: 1fr 1fr; } }
.stat-box {
  background: var(--blue-pale); border-radius: 10px; padding: 16px 14px; text-align: center;
}
.stat-box.accent { background: var(--navy); }
.stat-box.accent .stat-num, .stat-box.accent .stat-cap { color: #fff; }
.stat-box.accent .stat-num { color: var(--blue-light); }
.stat-num { font-size: 1.5rem; font-weight: 900; color: var(--navy); line-height: 1.1; }
.stat-cap { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 6px; font-weight: 600; }

/* Snowball vs Avalanche rows */
.dsa-row { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr 1fr 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
.dsa-row input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.86rem; font-family: inherit; }
.dsa-row input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.dsa-remove { background: var(--red-light); color: var(--red); border: none; border-radius: 6px; height: 34px; font-size: 1.2rem; cursor: pointer; line-height: 1; }
.dsa-remove:hover { background: #fca5a5; }
.dsa-head { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr 1fr 36px; gap: 8px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; margin-bottom: 6px; padding: 0 2px; }
@media (max-width: 680px) {
  .dsa-head { display: none; }
  .dsa-row { grid-template-columns: 1fr 1fr; }
  .dsa-row .dsa-name { grid-column: 1 / -1; }
  .dsa-remove { grid-column: 2; justify-self: end; width: 36px; }
}
/* Net Worth rows (label + value + remove) */
.nw-row { display: grid; grid-template-columns: 1fr 0.7fr 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
.nw-row input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.86rem; font-family: inherit; }
.nw-row input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.nw-add { background: var(--blue-pale); color: var(--blue); border: 1px dashed var(--blue-light); border-radius: 6px; padding: 8px 14px; font-size: 0.82rem; font-weight: 600; cursor: pointer; margin-top: 4px; }
.nw-add:hover { background: #e0ecff; }

.strategy-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
@media (max-width: 680px) { .strategy-compare { grid-template-columns: 1fr; } }
.strategy-col { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.strategy-col h3 { font-size: 1rem; color: var(--navy); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--blue); }
.strategy-col .s-line { font-size: 0.88rem; color: var(--text); margin-bottom: 6px; }
.strategy-col .s-line strong { color: var(--navy); }
.strategy-col ol { margin: 8px 0 0; padding-left: 1.3em; font-size: 0.85rem; color: var(--muted); }
.strategy-col ol li { margin-bottom: 3px; }

/* Affordability risk badge */
.aff-risk-badge { display: inline-block; font-size: 0.95rem; font-weight: 800; padding: 8px 18px; border-radius: 24px; margin-bottom: 12px; }
.aff-risk-badge.low { background: var(--green-light); color: var(--green-dark); }
.aff-risk-badge.medium { background: var(--amber-light); color: var(--amber); }
.aff-risk-badge.high { background: var(--red-light); color: #991b1b; }
#aff-risk-msg { font-size: 0.9rem; color: var(--text); line-height: 1.65; }

/* =============================================================================
   DIGITAL PRODUCTS  (downloadable templates / PDFs)
   .product-band  — reusable inline CTA (drop on any calculator/blog page)
   .product-grid / .product-card — listing on the Resources page
   ============================================================================= */
.product-band {
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center;
  background: linear-gradient(135deg, var(--navy), var(--slate));
  border-radius: 12px; padding: 22px 24px; margin: 24px 0; color: #fff;
}
.product-band .pb-icon { font-size: 2.4rem; line-height: 1; }
.product-band .pb-body h3 { font-size: 1.12rem; margin: 0 0 4px; color: #fff; }
.product-band .pb-body p { font-size: 0.9rem; color: rgba(255,255,255,0.75); margin: 0; line-height: 1.55; }
.product-band .pb-price { font-size: 0.9rem; font-weight: 700; color: var(--blue-light); margin-top: 8px; display: inline-block; }
.product-band .cta-btn { white-space: nowrap; }
@media (max-width: 680px) { .product-band { grid-template-columns: 1fr; text-align: center; gap: 14px; } }

.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 18px 0 8px; }
@media (max-width: 680px) { .product-grid { grid-template-columns: 1fr; } }
.product-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px; display: flex; flex-direction: column;
}
.product-badge {
  display: inline-block; align-self: flex-start; font-size: 0.68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--blue);
  background: var(--blue-pale); border-radius: 20px; padding: 4px 12px; margin-bottom: 12px;
}
.product-card h3 { font-size: 1.15rem; color: var(--navy); margin-bottom: 8px; line-height: 1.3; }
.product-card .pc-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.product-card ul.pc-features { list-style: none; padding: 0; margin: 0 0 16px; }
.product-card ul.pc-features li { font-size: 0.87rem; color: var(--text); padding: 4px 0 4px 22px; position: relative; }
.product-card ul.pc-features li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.product-card .pc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.product-card .pc-price { font-size: 1.25rem; font-weight: 900; color: var(--navy); }
.product-card .pc-price small { font-size: 0.72rem; font-weight: 600; color: var(--muted); }

/* Internal-link chip row */
.link-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.link-chips a {
  display: inline-block; background: var(--card); border: 1px solid var(--border);
  border-radius: 22px; padding: 8px 16px; font-size: 0.85rem; font-weight: 600;
  color: var(--blue); text-decoration: none; transition: border-color 0.15s, background 0.15s;
}
.link-chips a:hover { border-color: var(--blue); background: var(--blue-pale); text-decoration: none; }

/* "Coming soon" stub banner */
.stub-banner {
  background: var(--amber-light); border: 1px solid #fcd34d; color: #78350f;
  border-radius: 10px; padding: 18px 20px; margin: 20px 0; font-size: 0.92rem; line-height: 1.6;
}
.stub-banner strong { color: #78350f; }

/* Emergency-fund progress bar */
.ef-bar { background: var(--border); border-radius: 999px; height: 14px; overflow: hidden; margin: 6px 0 2px; }
.ef-bar > span { display: block; height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width 0.4s ease; }

/* Debt-consolidation debt rows (Balance / APR / Monthly + remove) */
.dc-head2 { display: grid; grid-template-columns: 1fr 0.8fr 1fr 36px; gap: 8px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; margin-bottom: 6px; padding: 0 2px; }
.dc-row { display: grid; grid-template-columns: 1fr 0.8fr 1fr 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
.dc-row input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.86rem; font-family: inherit; }
.dc-row input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
@media (max-width: 680px) { .dc-head2 { display: none; } .dc-row { grid-template-columns: 1fr 1fr; } }

/* Car-affordability 20/4/10 rule checklist */
.car-rules { list-style: none; padding: 0; margin: 14px 0 0; }
.car-rules li { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--text); }
.car-rules li:last-child { border-bottom: none; }

/* =============================================================================
   GREMLIN GAMES — game cards, filters & play stage
   Added on top of the shared template. Reuses .tool-grid / .tool-card.
   ============================================================================= */

/* Genre filter chips on the home grid */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.filter-chip {
  background: var(--card); border: 1px solid var(--border); color: var(--slate);
  border-radius: 22px; padding: 7px 16px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.filter-chip:hover { border-color: var(--blue); color: var(--blue); }
.filter-chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Game card tweaks (built on .tool-card) */
.game-card { padding-top: 22px; }
.game-card .game-emoji {
  font-size: 2rem; line-height: 1; width: 54px; height: 54px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-pale); border-radius: 12px;
}
.game-card.soon { opacity: 0.72; }
.game-card.soon:hover { transform: none; box-shadow: none; }
.badge-soon { background: var(--amber-light); color: var(--amber); }
.badge-live { background: var(--green-light); color: var(--green-dark); }
.btn-disabled {
  display: inline-block; background: var(--border); color: var(--muted) !important;
  padding: 9px 18px; border-radius: 7px; font-weight: 700; font-size: 0.88rem;
  cursor: not-allowed; pointer-events: none;
}

/* =============================================================================
   PLAY STAGE — shared shell for every game page
   ============================================================================= */
.game-stage {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; margin-bottom: 22px; box-shadow: 0 1px 3px rgba(13,27,46,0.05);
}
.game-topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.game-scores { display: flex; gap: 14px; flex-wrap: wrap; }
.score-pill {
  background: var(--blue-pale); border-radius: 10px; padding: 8px 16px; text-align: center; min-width: 84px;
}
.score-pill .sp-num { font-size: 1.35rem; font-weight: 900; color: var(--navy); line-height: 1.1; }
.score-pill .sp-cap { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; margin-top: 3px; }
.game-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* The canvas / board lives centered inside the stage */
.board-wrap { display: flex; justify-content: center; }
.board-wrap canvas { background: var(--navy); border-radius: 10px; touch-action: none; max-width: 100%; height: auto; }

.game-message {
  text-align: center; font-size: 0.95rem; color: var(--muted);
  min-height: 1.4em; margin-top: 14px; font-weight: 600;
}
.game-message.win { color: var(--green-dark); }
.game-message.lose { color: var(--red); }

.game-help { font-size: 0.82rem; color: var(--muted); text-align: center; margin-top: 6px; }
.game-help kbd {
  background: var(--navy); color: #fff; border-radius: 5px; padding: 2px 7px;
  font-size: 0.75rem; font-family: inherit; margin: 0 1px;
}

/* On-screen D-pad for touch devices */
.dpad { display: none; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 56px); gap: 8px; justify-content: center; margin: 16px auto 0; }
.dpad button {
  background: var(--navy); color: #fff; border: none; border-radius: 10px;
  font-size: 1.4rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.dpad button:active { background: var(--blue); }
.dpad .dp-up { grid-column: 2; grid-row: 1; }
.dpad .dp-left { grid-column: 1; grid-row: 2; }
.dpad .dp-right { grid-column: 3; grid-row: 2; }
.dpad .dp-down { grid-column: 2; grid-row: 3; }
@media (hover: none) and (pointer: coarse) { .dpad.show { display: grid; } }

/* =============================================================================
   2048 board
   ============================================================================= */
.g2048 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; background: var(--slate); padding: 10px; border-radius: 12px; width: min(100%, 380px); aspect-ratio: 1; }
.g2048 .cell { background: rgba(255,255,255,0.12); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.6rem; color: #fff; }
.g2048 .cell[data-v="2"]    { background: #eef3fb; color: #1e3a5f; }
.g2048 .cell[data-v="4"]    { background: #dbe8fb; color: #1e3a5f; }
.g2048 .cell[data-v="8"]    { background: #93c5fd; color: #0d1b2e; }
.g2048 .cell[data-v="16"]   { background: #60a5fa; }
.g2048 .cell[data-v="32"]   { background: #3b82f6; }
.g2048 .cell[data-v="64"]   { background: #2563eb; }
.g2048 .cell[data-v="128"]  { background: #1d4ed8; font-size: 1.4rem; }
.g2048 .cell[data-v="256"]  { background: #059669; font-size: 1.4rem; }
.g2048 .cell[data-v="512"]  { background: #047857; font-size: 1.4rem; }
.g2048 .cell[data-v="1024"] { background: #d97706; font-size: 1.15rem; }
.g2048 .cell[data-v="2048"] { background: #b45309; font-size: 1.15rem; }

/* =============================================================================
   Memory match grid
   ============================================================================= */
.mem-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; width: min(100%, 560px); }
.mem-card { aspect-ratio: 1; border: none; border-radius: 10px; background: var(--navy); cursor: pointer; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; transition: transform 0.1s, background 0.2s; }
.mem-card:hover { transform: translateY(-2px); }
.mem-card.flipped { background: var(--blue-pale); }
.mem-card.matched { background: var(--green-light); cursor: default; }
.mem-card .face { display: none; }
.mem-card.flipped .face, .mem-card.matched .face { display: block; }

/* =============================================================================
   Tic-Tac-Toe board
   ============================================================================= */
.ttt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(100%, 320px); }
.ttt-cell { aspect-ratio: 1; border: 2px solid var(--border); border-radius: 10px; background: var(--card); font-size: 2.4rem; font-weight: 900; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ttt-cell:hover { border-color: var(--blue); }
.ttt-cell.x { color: var(--blue); }
.ttt-cell.o { color: var(--green); }
.ttt-cell:disabled { cursor: default; }

/* =============================================================================
   Minesweeper board
   ============================================================================= */
.ms-grid { display: grid; gap: 3px; background: var(--slate); padding: 6px; border-radius: 10px; }
.ms-cell { width: 30px; height: 30px; border: none; border-radius: 4px; background: #cbd5e1; font-weight: 800; font-size: 0.95rem; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.ms-cell.revealed { background: #eef3fb; cursor: default; }
.ms-cell.mine { background: var(--red); }
.ms-cell.flag { background: var(--amber-light); }
.ms-cell[data-n="1"] { color: #2563eb; }
.ms-cell[data-n="2"] { color: #059669; }
.ms-cell[data-n="3"] { color: #dc2626; }
.ms-cell[data-n="4"] { color: #1d4ed8; }
.ms-cell[data-n="5"] { color: #b45309; }
.ms-cell[data-n="6"] { color: #0891b2; }
@media (max-width: 480px) { .ms-cell { width: 26px; height: 26px; font-size: 0.85rem; } }

/* =============================================================================
   Solitaire (Klondike)
   ============================================================================= */
.sol-board { --cw: 64px; --ch: 90px; --ov: 24px; max-width: 540px; margin: 0 auto; }
.sol-top { display: grid; grid-template-columns: repeat(7, var(--cw)); gap: 8px; justify-content: center; margin-bottom: 18px; }
.sol-tableau { display: grid; grid-template-columns: repeat(7, var(--cw)); gap: 8px; justify-content: center; align-items: start; }
.sol-pile { width: var(--cw); height: var(--ch); border-radius: 7px; }
.sol-col { width: var(--cw); min-height: var(--ch); }
.sol-pile:empty, .sol-col:empty { border: 2px dashed rgba(148,163,184,0.55); border-radius: 7px; }
.sol-foundation:empty { border-color: rgba(59,130,246,0.5); }

.sol-card {
  width: var(--cw); height: var(--ch); border-radius: 7px; background: #fff;
  border: 1px solid #cbd5e1; position: relative; font-weight: 800; cursor: pointer;
  box-shadow: 0 1px 2px rgba(13,27,46,0.18); -webkit-user-select: none; user-select: none;
}
.sol-card.down { background: repeating-linear-gradient(45deg, #1e3a5f, #1e3a5f 6px, #16304f 6px, #16304f 12px); border-color: #0d1b2e; cursor: pointer; }
.sol-card.red { color: #dc2626; }
.sol-card.black { color: #0d1b2e; }
.sol-card .corner { position: absolute; top: 4px; left: 6px; font-size: 0.82rem; line-height: 1; }
.sol-card .pip { position: absolute; bottom: 6px; right: 8px; font-size: 1.4rem; opacity: 0.85; }
.sol-card.selected { outline: 3px solid var(--blue); outline-offset: -1px; }
.sol-col .sol-card { display: block; }
.sol-col .sol-card + .sol-card { margin-top: calc(var(--ov) - var(--ch)); }
.sol-recycle { display: flex; align-items: center; justify-content: center; height: var(--ch); color: var(--muted); font-size: 1.6rem; border: 2px dashed rgba(148,163,184,0.55); border-radius: 7px; }

@media (max-width: 560px) {
  .sol-board { --cw: 42px; --ch: 60px; --ov: 17px; }
  .sol-top, .sol-tableau { gap: 5px; }
  .sol-card .corner { font-size: 0.62rem; top: 2px; left: 3px; }
  .sol-card .pip { font-size: 0.95rem; bottom: 2px; right: 3px; }
}

/* FreeCell — reuses .sol-card / .sol-pile / .sol-col, 8 columns */
.fc-board { --cw: 58px; --ch: 80px; --ov: 22px; max-width: 640px; margin: 0 auto; }
.fc-top { display: grid; grid-template-columns: repeat(8, var(--cw)); gap: 8px; justify-content: center; margin-bottom: 18px; }
.fc-tableau { display: grid; grid-template-columns: repeat(8, var(--cw)); gap: 8px; justify-content: center; align-items: start; }
.sol-free:empty { border-color: rgba(148,163,184,0.6); }

/* Spider — 10 columns plus a stock stack */
.sp-board { --cw: 50px; --ch: 70px; --ov: 18px; max-width: 680px; margin: 0 auto; }
.sp-controls { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-bottom: 14px; }
.sp-stock { display: flex; cursor: pointer; min-width: var(--cw); min-height: var(--ch); }
.sp-stock .sol-card { width: var(--cw); height: var(--ch); }
.sp-stock .sp-stock-card + .sp-stock-card { margin-left: -42px; }
.sp-stock-label { font-size: 0.82rem; color: var(--muted); }
.sp-tableau { display: grid; grid-template-columns: repeat(10, var(--cw)); gap: 6px; justify-content: center; align-items: start; }

@media (max-width: 680px) {
  .fc-board { --cw: 40px; --ch: 56px; --ov: 16px; }
  .fc-top, .fc-tableau { gap: 4px; }
  .sp-board { --cw: 32px; --ch: 46px; --ov: 13px; }
  .sp-tableau { gap: 3px; }
  .sp-stock .sp-stock-card + .sp-stock-card { margin-left: -26px; }
  .sp-stock-label { display: none; }
  .fc-board .sol-card .corner, .sp-board .sol-card .corner { font-size: 0.58rem; top: 2px; left: 2px; }
  .fc-board .sol-card .pip, .sp-board .sol-card .pip { font-size: 0.9rem; bottom: 2px; right: 2px; }
}

/* =============================================================================
   Whack-a-Gremlin
   ============================================================================= */
.wg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: min(100%, 420px); margin: 0 auto; }
.wg-hole {
  position: relative; aspect-ratio: 1; background: var(--slate); border: none;
  border-radius: 16px; cursor: pointer; overflow: hidden; padding: 0;
  display: flex; align-items: flex-end; justify-content: center;
  transition: background 0.12s;
}
.wg-hole::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 32%;
  background: var(--navy); border-radius: 0 0 16px 16px; z-index: 2;
}
.wg-gremlin {
  position: absolute; left: 0; right: 0; bottom: -65%; text-align: center;
  font-size: 2.8rem; line-height: 1; z-index: 1;
  transition: bottom 0.14s ease;
}
.wg-hole.up .wg-gremlin { bottom: 18%; }
.wg-hole.hit { background: var(--green); }
@media (max-width: 480px) { .wg-gremlin { font-size: 2rem; } .wg-grid { gap: 10px; } }

/* =============================================================================
   Connect Four
   ============================================================================= */
.c4-board {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  background: #1d4ed8; padding: 12px; border-radius: 16px;
  width: min(100%, 430px); margin: 0 auto;
}
.c4-cell {
  aspect-ratio: 1; background: var(--navy); border: none; border-radius: 50%;
  cursor: pointer; padding: 0; box-shadow: inset 0 2px 4px rgba(0,0,0,0.35);
}
.c4-cell.r { background: #ef4444; }
.c4-cell.y { background: #facc15; }
.c4-cell.r, .c4-cell.y { box-shadow: inset 0 -3px 5px rgba(0,0,0,0.25); }
.c4-cell.win { box-shadow: 0 0 0 4px #fff; }
.c4-cell.drop { animation: c4drop 0.22s ease-out; }
@keyframes c4drop { from { transform: translateY(-300%); } to { transform: translateY(0); } }
.c4-board.thinking { pointer-events: none; }

/* =============================================================================
   Simon Says
   ============================================================================= */
.simon-board {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  width: min(100%, 300px); margin: 0 auto;
}
.simon-pad {
  aspect-ratio: 1; border: none; cursor: pointer; opacity: 0.5; padding: 0;
  transition: opacity 0.08s, box-shadow 0.08s;
}
.simon-pad.active { opacity: 1; box-shadow: 0 0 26px rgba(255,255,255,0.7); }
.simon-pad.green  { background: #22c55e; border-radius: 100% 0 0 0; }
.simon-pad.red    { background: #ef4444; border-radius: 0 100% 0 0; }
.simon-pad.yellow { background: #facc15; border-radius: 0 0 0 100%; }
.simon-pad.blue   { background: #3b82f6; border-radius: 0 0 100% 0; }
.simon-board.locked { pointer-events: none; }

/* =============================================================================
   Lights Out
   ============================================================================= */
.lo-board { display: grid; gap: 8px; width: min(100%, 360px); margin: 0 auto; }
.lo-cell { aspect-ratio: 1; border: none; border-radius: 10px; cursor: pointer; background: var(--navy); transition: background 0.1s, box-shadow 0.1s; padding: 0; }
.lo-cell.on { background: #facc15; box-shadow: 0 0 16px rgba(250,204,21,0.6); }

/* =============================================================================
   Hangman
   ============================================================================= */
.hm-category { text-align: center; font-size: 0.9rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.hm-word { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0 6px; min-height: 2rem; }
.hm-letter { width: 26px; border-bottom: 3px solid var(--slate); font-size: 1.6rem; font-weight: 800; text-align: center; color: var(--navy); }
.hm-keys { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; max-width: 480px; margin: 16px auto 0; }
.hm-key { padding: 10px 0; border: 1px solid var(--border); border-radius: 7px; background: var(--card); font-weight: 700; cursor: pointer; font-family: inherit; }
.hm-key:disabled { cursor: default; }
.hm-key.good { background: var(--green-light); color: var(--green-dark); border-color: #6ee7b7; }
.hm-key.bad { background: var(--red-light); color: #991b1b; border-color: #fca5a5; opacity: 0.85; }
@media (max-width: 480px) { .hm-keys { grid-template-columns: repeat(7, 1fr); } }

/* =============================================================================
   Sudoku
   ============================================================================= */
.sdk-board { display: grid; grid-template-columns: repeat(9, 1fr); width: min(100%, 450px); margin: 0 auto; border: 3px solid var(--slate); border-radius: 8px; overflow: hidden; }
.sdk-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; background: #fff; cursor: pointer; border: 1px solid var(--border); color: var(--blue-dark); -webkit-user-select: none; user-select: none; }
.sdk-cell.given { color: var(--navy); font-weight: 800; cursor: default; background: #eef3fb; }
.sdk-cell.sel { background: #dbeafe; }
.sdk-cell.conflict { color: var(--red); background: var(--red-light); }
.sdk-cell.br { border-right: 2px solid var(--slate); }
.sdk-cell.bb { border-bottom: 2px solid var(--slate); }
@media (max-width: 480px) { .sdk-cell { font-size: 1rem; } }
.sdk-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 380px; margin: 16px auto 0; }
.sdk-pad button { padding: 12px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--card); font-weight: 800; font-size: 1.05rem; cursor: pointer; font-family: inherit; }
.sdk-pad button:hover { border-color: var(--blue); background: var(--blue-pale); }
.sdk-notes { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 100%; height: 100%; }
.sdk-notes span { display: flex; align-items: center; justify-content: center; font-size: 0.52rem; line-height: 1; font-weight: 600; color: var(--muted); }
.cta-btn.active { background: var(--blue) !important; color: #fff !important; border-color: var(--blue) !important; }

/* =============================================================================
   Local leaderboard (shared, top-5)
   ============================================================================= */
.gg-leaderboard { max-width: 360px; margin: 22px auto 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.gg-leaderboard h3 { margin: 0 0 8px; font-size: 1rem; color: var(--navy); text-align: center; }
.gg-leaderboard ol { list-style: none; margin: 0; padding: 0; }
.gg-leaderboard li { display: flex; align-items: center; justify-content: space-between; padding: 7px 4px; border-bottom: 1px solid var(--border); font-weight: 700; }
.gg-leaderboard li:last-child { border-bottom: none; }
.gg-leaderboard .lb-rank { width: 1.6em; height: 1.6em; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-pale); color: var(--blue-dark); border-radius: 50%; font-size: 0.82rem; margin-right: 10px; }
.gg-leaderboard li:first-child .lb-rank { background: #fde68a; color: #92400e; }
.gg-leaderboard .lb-score { margin-left: auto; color: var(--blue-dark); }
.gg-leaderboard .lb-empty { justify-content: center; color: var(--muted); font-weight: 500; border-bottom: none; }

/* =============================================================================
   15 Puzzle
   ============================================================================= */
.p15-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 360px); margin: 0 auto; background: var(--slate); padding: 8px; border-radius: 12px; }
.p15-tile { aspect-ratio: 1; border: none; border-radius: 10px; background: var(--blue); color: #fff; font-size: 1.5rem; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.p15-tile.blank { background: transparent; cursor: default; }
.p15-tile.correct { background: var(--green); }

/* =============================================================================
   Word Guess
   ============================================================================= */
.wd-board { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; width: min(100%, 320px); margin: 0 auto 10px; }
.wd-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wd-tile { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800; border: 2px solid var(--border); border-radius: 6px; text-transform: uppercase; color: var(--navy); }
.wd-tile.filled { border-color: var(--border-strong); }
.wd-tile.correct { background: var(--green); border-color: var(--green); color: #fff; }
.wd-tile.present { background: var(--amber); border-color: var(--amber); color: #fff; }
.wd-tile.absent { background: var(--slate); border-color: var(--slate); color: #fff; }
.wd-keys { display: flex; flex-direction: column; gap: 6px; max-width: 500px; margin: 0 auto; }
.wd-krow { display: flex; gap: 5px; justify-content: center; }
.wd-key { flex: 1; min-width: 0; padding: 14px 2px; border: none; border-radius: 6px; background: var(--border); color: var(--navy); font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.8rem; text-transform: uppercase; }
.wd-key.wide { flex: 1.6; font-size: 0.7rem; }
.wd-key.correct { background: var(--green); color: #fff; }
.wd-key.present { background: var(--amber); color: #fff; }
.wd-key.absent { background: var(--slate); color: #fff; }

/* =============================================================================
   Reaction Test
   ============================================================================= */
.rt-pad { height: 280px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; color: #fff; font-size: 1.5rem; font-weight: 800; text-align: center; padding: 20px; -webkit-user-select: none; user-select: none; }
.rt-pad.wait { background: var(--slate); }
.rt-pad.ready { background: var(--red); }
.rt-pad.now { background: var(--green); }
.rt-pad.result { background: var(--navy); }
.rt-pad small { font-size: 0.95rem; font-weight: 500; opacity: 0.85; margin-top: 10px; }

/* =============================================================================
   Typing Sprint
   ============================================================================= */
.ty-display { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; font-size: 1.2rem; line-height: 1.9; margin-bottom: 14px; min-height: 80px; }
.ty-word { padding: 2px 5px; border-radius: 4px; color: var(--muted); }
.ty-word.current { background: var(--blue); color: #fff; font-weight: 700; }
.ty-input { width: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: 8px; font-size: 1.05rem; font-family: inherit; }
.ty-input:focus { outline: none; border-color: var(--blue); }
.ty-input:disabled { background: var(--bg); }

/* =============================================================================
   Color Match (Stroop)
   ============================================================================= */
.cm-word { font-size: 3rem; font-weight: 900; text-align: center; margin: 26px 0; min-height: 3.4rem; }
.cm-q { text-align: center; color: var(--muted); font-size: 0.95rem; }
.cm-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }
.cm-buttons button { min-width: 120px; }

/* =============================================================================
   Math Blitz
   ============================================================================= */
.mb-q { font-size: 2.4rem; font-weight: 900; text-align: center; color: var(--navy); margin: 18px 0; min-height: 2.8rem; }
.mb-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 340px; margin: 0 auto; }
.mb-choices button { padding: 16px 0; border: 1px solid var(--border); border-radius: 10px; background: var(--card); font-size: 1.3rem; font-weight: 800; cursor: pointer; font-family: inherit; }
.mb-choices button:hover { border-color: var(--blue); background: var(--blue-pale); }
.mb-choices button.wrong { background: var(--red-light); border-color: var(--red); }

/* =============================================================================
   TEXT ADVENTURES — hub cards, reading UI, choices, ad slots
   ============================================================================= */
/* Generic ad placeholder requested by the spec; hidden by default (review-safe),
   like the other ad containers. Auto Ads serve here once AdSense is approved. */
.ad-slot { margin: 20px auto; text-align: center; max-width: 728px; }

.ta-genre { font-size: 0.75rem; color: var(--blue); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.ta-meta { font-size: 0.8rem; color: var(--muted); }
.badge-genre { background: var(--blue-pale); color: var(--blue-dark); }

/* Daily Adventure feature banner */
.ta-daily { display: none; background: linear-gradient(135deg, var(--navy), var(--slate)); color: #fff; border-radius: 14px; padding: 22px 24px; margin: 4px 0 24px; }
.ta-daily.show { display: block; }
.ta-daily .ta-daily-tag { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--blue-light); }
.ta-daily h3 { font-size: 1.4rem; margin: 6px 0 6px; color: #fff; }
.ta-daily p { color: rgba(255,255,255,0.75); font-size: 0.92rem; margin-bottom: 14px; max-width: 640px; }

/* Status bar (stateful stories) */
.ta-status { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 680px; margin: 0 auto 16px; }
.ta-stat { background: var(--navy); color: #fff; border-radius: 20px; padding: 6px 14px; font-size: 0.82rem; font-weight: 600; }
.ta-stat b { color: var(--blue-light); font-weight: 800; }

/* Resume banner — shown when a saved game is loaded partway through */
.ta-resume { max-width: 680px; margin: 0 auto 18px; background: var(--blue-pale); border: 1px solid var(--blue); border-radius: 10px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.92rem; color: var(--navy); }
.ta-resume-restart { background: var(--card); border: 1px solid var(--blue); border-radius: 7px; padding: 8px 14px; font-weight: 700; font-size: 0.82rem; color: var(--blue); cursor: pointer; font-family: inherit; white-space: nowrap; }
.ta-resume-restart:hover { background: var(--blue); color: #fff; }

/* Reading area */
.ta-story { max-width: 680px; margin: 0 auto; min-height: 160px; }
.ta-text p { font-size: 1.12rem; line-height: 1.78; color: var(--text); margin-bottom: 16px; }
.ta-text p:first-child::first-letter { font-size: 2.6rem; font-weight: 800; line-height: 1; float: left; padding: 4px 10px 0 0; color: var(--blue); }
.ta-loading, .ta-error { text-align: center; color: var(--muted); padding: 24px 0; }
.ta-error { color: var(--red); }

/* Choice buttons — large, full-width, comfortably spaced (no ads nearby) */
.ta-choices { display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin: 22px auto 0; }
.ta-choice { display: block; width: 100%; text-align: left; background: var(--card); border: 2px solid var(--border); border-radius: 10px; padding: 15px 18px; font-size: 1rem; font-weight: 600; color: var(--navy); cursor: pointer; font-family: inherit; transition: border-color 0.15s, background 0.15s, transform 0.1s; }
.ta-choice:hover { border-color: var(--blue); background: var(--blue-pale); transform: translateY(-1px); }
.ta-choice.ta-restart { text-align: center; color: var(--blue); border-style: dashed; }

.ta-ending { max-width: 680px; margin: 22px auto 0; padding: 14px 18px; border-radius: 10px; font-weight: 800; text-align: center; }
.ta-ending-good { background: var(--green-light); color: var(--green-dark); }
.ta-ending-bad { background: var(--red-light); color: #991b1b; }
.ta-ending-neutral { background: var(--blue-pale); color: var(--blue-dark); }

.ta-controls { display: flex; gap: 10px; justify-content: center; margin: 22px auto 0; flex-wrap: wrap; max-width: 680px; }
.ta-controls button { background: var(--card); border: 1px solid var(--border); border-radius: 7px; padding: 9px 16px; font-weight: 700; font-size: 0.85rem; color: var(--slate); cursor: pointer; font-family: inherit; }
.ta-controls button:hover { border-color: var(--blue); color: var(--blue); }
.ta-controls button:disabled { opacity: 0.4; cursor: default; }

.ta-frame { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 12px; background: #fff; }

/* =============================================================================
   Daily Word (Wordle-style)
   ============================================================================= */
.dw-num { color: var(--blue); font-weight: 800; font-size: 0.9em; }
.dw-board { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; width: min(100%, 330px); margin: 0 auto 4px; }
.dw-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dw-tile { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.5rem; text-transform: uppercase; color: var(--navy); background: #fff; border: 2px solid var(--border); border-radius: 6px; -webkit-user-select: none; user-select: none; }
.dw-tile.filled { border-color: var(--muted); }
.dw-tile.correct { background: #059669; border-color: #059669; color: #fff; }
.dw-tile.present { background: #d9a514; border-color: #d9a514; color: #fff; }
.dw-tile.absent { background: #64748b; border-color: #64748b; color: #fff; }
.dw-keys { width: min(100%, 500px); margin: 14px auto 0; display: flex; flex-direction: column; gap: 7px; }
.dw-keyrow { display: flex; gap: 5px; justify-content: center; }
.dw-key { flex: 1 1 0; min-width: 0; max-width: 44px; height: 52px; border: none; border-radius: 6px; background: #cbd5e1; color: var(--navy); font-weight: 700; font-size: 1rem; cursor: pointer; font-family: inherit; text-transform: uppercase; }
.dw-key.wide { flex: 1.6 1 0; max-width: 66px; font-size: 0.72rem; }
.dw-key:hover { filter: brightness(0.95); }
.dw-key.correct { background: #059669; color: #fff; }
.dw-key.present { background: #d9a514; color: #fff; }
.dw-key.absent { background: #64748b; color: #fff; }
.dw-stats-row { display: flex; gap: 14px; }
.dw-stat { text-align: center; }
.dw-stat-n { font-size: 1.3rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.dw-stat-l { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.dw-chip { display: inline-block; padding: 1px 7px; border-radius: 4px; color: #fff; font-weight: 700; font-size: 0.82em; }
.dw-chip.dw-c { background: #059669; } .dw-chip.dw-p { background: #d9a514; } .dw-chip.dw-a { background: #64748b; }
@media (max-width: 420px) { .dw-tile { font-size: 1.25rem; } .dw-key { height: 46px; } }

/* Per-user daily streak widget (homepage) */
.daily-widget { margin: 6px 0 26px; }
.dwgt-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dwgt-head h2 { margin: 0; font-size: 1.15rem; color: var(--navy); }
.dwgt-sub { font-size: 0.8rem; color: var(--muted); }
.dwgt-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.dwgt-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: 12px; text-decoration: none; transition: transform 0.1s, box-shadow 0.15s; }
.dwgt-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(13,27,46,0.1); }
.dwgt-card.done { border-left-color: var(--green); background: var(--green-light, #ecfdf5); }
.dwgt-emoji { font-size: 1.9rem; line-height: 1; }
.dwgt-body { flex: 1; min-width: 0; }
.dwgt-name { font-weight: 800; color: var(--navy); font-size: 1.02rem; }
.dwgt-stat { font-size: 0.86rem; color: var(--slate); margin-top: 2px; }
.dwgt-stat b { color: var(--blue-dark); }
.dwgt-go { font-weight: 700; font-size: 0.82rem; color: var(--blue); white-space: nowrap; }
.dwgt-card.done .dwgt-go { color: var(--green); }
@media (max-width: 560px) { .dwgt-cards { grid-template-columns: 1fr; } }

/* hide the spec's .ad-slot placeholders until real ads are live (see note above) */
.ad-leaderboard, .in-content-ad, .ad-incontent, .ad-box, .ad-slot { display: none !important; }
