/* ============================================================
   FivLet — style.css
   Apple-inspired with flavor. Light default, dark via [data-theme="dark"]
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Variables: Light Mode ── */
:root {
  --bg-page:          #f2f2f7;
  --bg-nav:           rgba(255,255,255,0.92);
  --bg-card:          #ffffff;
  --bg-input:         #f2f2f7;
  --bg-clue:          linear-gradient(135deg, #e8f0ff, #eef4ff);
  --bg-tile:          #f2f2f7;
  --bg-tile-hint:     #e8f0ff;
  --bg-badge:         #e8f0ff;
  --bg-ad:            #e5e5ea;
  --bg-seo:           #ffffff;
  --bg-modal:         #ffffff;
  --bg-modal-back:    rgba(0,0,0,0.4);
  --bg-toast:         #1d1d1f;
  --bg-ghost:         #f2f2f7;
  --bg-danger:        #fff0f0;
  --bg-pill:          #e5e5ea;
  --bg-footer:        rgba(255,255,255,0.8);

  --border-nav:       rgba(0,0,0,0.08);
  --border-card:      transparent;
  --border-input:     #d1d1d6;
  --border-tile:      #e5e5ea;
  --border-tile-hint: #0055cc;
  --border-clue:      transparent;
  --border-ad:        #ccc;
  --border-badge:     transparent;
  --border-ghost:     #d1d1d6;
  --border-danger:    #ffb3b0;
  --border-pill:      transparent;
  --border-signin:    transparent;
  --border-footer:    rgba(0,0,0,0.06);

  --text-primary:     #1d1d1f;
  --text-secondary:   #6e6e73;
  --text-muted:       #aeaeb2;
  --text-nav-link:    #888888;
  --text-nav-active:  #1d1d1f;
  --text-clue:        #1d1d1f;
  --text-badge:       #0044aa;
  --text-tile:        #cccccc;
  --text-tile-hint:   #0055cc;
  --text-ghost:       #555555;
  --text-danger:      #c0392b;
  --text-footer:      #888888;
  --text-seo:         #888888;
  --text-toast:       #f5f5f7;
  --text-pill:        #555555;
  --text-signin:      #ffffff;

  --accent:           #0055cc;
  --accent-hover:     #0044aa;
  --accent-bg:        #e8f0ff;
  --accent-border:    rgba(0,85,204,0.2);
  --accent-label:     #0055cc;

  --win-bg:           #e8ffe8;
  --win-border:       #1a7f4b;
  --win-text:         #1a7f4b;
  --lose-bg:          #fff0f0;
  --lose-border:      #c0392b;
  --lose-text:        #c0392b;

  --shadow-card:      0 1px 0 rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-modal:     0 20px 60px rgba(0,0,0,0.15);

  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Helvetica Neue', sans-serif;

  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-pill: 20px;
  --transition:  0.2s ease;
}

/* ── Variables: Dark Mode ── */
[data-theme="dark"] {
  --bg-page:          #0a0a0a;
  --bg-nav:           #111111;
  --bg-card:          #161616;
  --bg-input:         #1c1c1c;
  --bg-clue:          #1a1a2e;
  --bg-tile:          #1c1c1c;
  --bg-tile-hint:     rgba(77,159,255,0.12);
  --bg-badge:         rgba(77,159,255,0.12);
  --bg-ad:            #111111;
  --bg-seo:           #161616;
  --bg-modal:         #161616;
  --bg-modal-back:    rgba(0,0,0,0.75);
  --bg-toast:         #2a2a2a;
  --bg-ghost:         #1c1c1c;
  --bg-danger:        rgba(255,69,58,0.1);
  --bg-pill:          #1c1c1c;
  --bg-footer:        #111111;

  --border-nav:       #222222;
  --border-card:      #252525;
  --border-input:     #2a2a2a;
  --border-tile:      #2a2a2a;
  --border-tile-hint: #4d9fff;
  --border-clue:      #4d9fff;
  --border-ad:        #222222;
  --border-badge:     rgba(77,159,255,0.2);
  --border-ghost:     #2a2a2a;
  --border-danger:    rgba(255,69,58,0.25);
  --border-pill:      #333333;
  --border-signin:    transparent;
  --border-footer:    #1a1a1a;

  --text-primary:     #ffffff;
  --text-secondary:   #aaaaaa;
  --text-muted:       #444444;
  --text-nav-link:    #555555;
  --text-nav-active:  #ffffff;
  --text-clue:        #e0e0e0;
  --text-badge:       #4d9fff;
  --text-tile:        #333333;
  --text-tile-hint:   #4d9fff;
  --text-ghost:       #cccccc;
  --text-danger:      #ff453a;
  --text-footer:      #444444;
  --text-seo:         #555555;
  --text-toast:       #ffffff;
  --text-pill:        #aaaaaa;
  --text-signin:      #ffffff;

  --accent:           #0055cc;
  --accent-hover:     #1166dd;
  --accent-bg:        rgba(77,159,255,0.12);
  --accent-border:    rgba(77,159,255,0.2);
  --accent-label:     #4d9fff;

  --win-bg:           rgba(48,209,88,0.1);
  --win-border:       rgba(48,209,88,0.3);
  --win-text:         #30d158;
  --lose-bg:          rgba(255,69,58,0.1);
  --lose-border:      rgba(255,69,58,0.25);
  --lose-text:        #ff453a;

  --shadow-card:      0 2px 20px rgba(0,0,0,0.4);
  --shadow-modal:     0 20px 60px rgba(0,0,0,0.6);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.8; }
input, button, select, textarea { font-family: var(--font-body); }

/* ── Layout ── */
.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

.container {
  width: 70%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ── */
.site-nav {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border-nav);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background var(--transition);
  width: 100%;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  gap: 24px;
  width: 70%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  font-size: 19px;
  font-weight: 800;
  color: var(--accent-label);
  letter-spacing: -0.5px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo span { color: var(--text-primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-nav-link);
  text-decoration: none;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active,
.nav-links a.nav-active {
  color: var(--text-nav-active);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle {
  font-size: 12px;
  color: var(--text-pill);
  background: var(--bg-pill);
  border: 1px solid var(--border-pill);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.theme-toggle:hover { opacity: 0.75; }

.btn-signin {
  font-size: 13px;
  color: var(--text-signin);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-pill);
  padding: 6px 18px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-signin:hover { background: var(--accent-hover); }

.nav-signout {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-ghost);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-signout:hover { color: var(--text-danger); }

.nav-username {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.premium-badge {
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

/* ── Ad Slots ── */
.ad-slot {
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ad-slot-top {
  height: 70px;
  margin: 14px auto;
  width: 100%;
}

.ad-slot-side {
  height: 280px;
  width: 180px;
}

/* ── Main Layout ── */
.main-body { flex: 1; padding: 0 0 40px; }

.content-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  width: 100%;
}

.content-main { flex: 1; min-width: 0; }
.content-sidebar { width: 180px; flex-shrink: 0; }

/* ── Game Card ── */
.game-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: background var(--transition);
}

[data-theme="dark"] .game-card { border: 1px solid var(--border-card); }

.game-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.game-badges { display: flex; gap: 7px; flex-wrap: wrap; }

.game-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-badge);
  background: var(--bg-badge);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
}

.difficulty-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.toggle-switch {
  position: relative;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: #d1d1d6;
  border-radius: 9px;
  cursor: pointer;
  transition: background var(--transition);
}

[data-theme="dark"] .toggle-track { background: #2a2a2a; border: 1px solid #333; }
.toggle-switch input:checked + .toggle-track { background: var(--accent); }

.toggle-track::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-track::after { transform: translateX(14px); }

/* Play count */
.play-count {
  font-size: 12px;
  color: #0044aa;
  text-align: center;
  margin-bottom: 14px;
  padding: 5px 14px;
  background: #e8f0ff;
  border: 1px solid #c0d4f5;
  border-radius: var(--radius-pill);
  display: inline-block;
  width: 100%;
  font-weight: 600;
}

[data-theme="dark"] .play-count {
  color: var(--text-badge);
  background: var(--bg-badge);
  border: 1px solid var(--border-badge);
}

/* Clue */
.clue-box {
  background: var(--bg-clue);
  border-left: 3px solid var(--accent-label);
  border-radius: var(--radius-md);
  padding: 15px 17px;
  margin-bottom: 22px;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

[data-theme="dark"] .clue-box {
  border: 1px solid var(--border-clue);
  border-left: 3px solid var(--accent-label);
}

.clue-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-label);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.clue-text, #clue-text {
  font-size: 13px;
  color: var(--text-clue);
  line-height: 1.55;
}

/* Word tiles */
.word-tiles {
  display: flex;
  gap: 9px;
  justify-content: center;
  margin-bottom: 22px;
}

.letter-tile {
  width: 54px;
  height: 62px;
  border-radius: var(--radius-md);
  background: var(--bg-tile);
  border: 2px solid var(--border-tile);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-tile);
  transition: all var(--transition);
}

.letter-tile.tile-hint {
  background: var(--bg-tile-hint);
  border: 2px solid var(--border-tile-hint);
  color: var(--text-tile-hint);
}

.letter-tile.tile-win {
  background: var(--win-bg);
  border: 2px solid var(--win-border);
  color: var(--win-text);
  animation: tile-pop 0.3s ease;
}

.letter-tile.tile-lose {
  background: var(--lose-bg);
  border: 2px solid var(--lose-border);
  color: var(--lose-text);
  animation: tile-pop 0.3s ease;
}

@keyframes tile-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* Guess history */
.guesses-container {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 10px;
}

.guess-row { display: flex; gap: 5px; }

.guess-letter {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-badge);
  color: var(--text-secondary);
}

/* Used letters */
.used-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 18px;
  min-height: 10px;
}

.used-letter {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.used-letter-correct {
  background: var(--win-bg);
  border: 1px solid var(--win-border);
  color: var(--win-text);
}

.used-letter-incorrect {
  background: var(--lose-bg);
  border: 1px solid var(--lose-border);
  color: var(--lose-text);
}

/* Guess input */
.guess-row-input {
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
}

.guess-input {
  flex: 1;
  background: var(--bg-input);
  border: 2px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  transition: border-color var(--transition);
}

[data-theme="dark"] .guess-input { border: 2px solid var(--border-input); }
.guess-input:focus { border-color: var(--accent); }
.guess-input::placeholder {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.guess-input:disabled { opacity: 0.4; cursor: not-allowed; }

/* Buttons */
.game-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 9px;
}

.btn {
  padding: 10px 8px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  -webkit-font-smoothing: antialiased;
}

.btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

.btn-outline {
  background: var(--bg-ghost);
  border: 1px solid var(--border-ghost);
  color: var(--text-ghost);
}

.btn-outline:hover:not(:disabled) { opacity: 0.75; }

.btn-danger {
  background: var(--bg-danger);
  border: 1px solid var(--border-danger);
  color: var(--text-danger);
}

.btn-danger:hover:not(:disabled) { opacity: 0.8; }

.btn-primary {
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 700;
}

.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-full {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  font-size: 14px;
}

#upgrade-btn { margin-top: 14px; }

/* ── SEO Block ── */
.seo-block {
  background: var(--bg-seo);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-seo);
  line-height: 1.7;
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .seo-block { border: 1px solid var(--border-card); }

.seo-block h1,
.seo-block h2 {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-label);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.seo-block p + p { margin-top: 8px; }

.seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.seo-links a { font-size: 12px; color: var(--accent-label); }

/* ── Loading Overlay ── */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ── Modals ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-back);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-modal);
  position: relative;
}

[data-theme="dark"] .modal { border: 1px solid var(--border-card); }

.modal h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.modal p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-ghost);
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--bg-danger); color: var(--text-danger); }

.modal-input {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  margin-bottom: 8px;
  transition: border-color var(--transition);
}

.modal-input:focus { border-color: var(--accent); }

.modal-error {
  font-size: 12px;
  color: var(--text-danger);
  margin-bottom: 12px;
  min-height: 16px;
}

.modal-buttons { display: flex; gap: 8px; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-toast);
  color: var(--text-toast);
  border-radius: var(--radius-pill);
  padding: 11px 22px;
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  white-space: nowrap;
  max-width: calc(100vw - 40px);
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.toast.toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Cookie Consent ── */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-nav);
  border-top: 1px solid var(--border-nav);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 100;
  font-size: 12px;
  color: var(--text-secondary);
  backdrop-filter: blur(20px);
}

.cookie-consent a { color: var(--accent); }

/* ── Footer ── */
.site-footer {
  background: var(--bg-footer);
  border-top: 1px solid var(--border-footer);
  padding: 14px 0;
  margin-top: auto;
  width: 100%;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  width: 70%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
}

.footer-links a {
  font-size: 11px;
  color: var(--text-footer);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--text-primary); }
.footer-copy { font-size: 11px; color: var(--text-muted); }

/* ── Leaderboard ── */
.leaderboard-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--border-tile);
}

.leaderboard-tab {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--transition);
  text-align: center;
}

.leaderboard-tab.tab-active { background: var(--accent); color: #fff; }

.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.leaderboard-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-tile);
}

.leaderboard-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-tile);
  color: var(--text-primary);
}

.leaderboard-row-top td { background: var(--accent-bg); }
.leaderboard-rank { font-weight: 700; font-size: 15px; }
.rank-gold   { color: #f5c518; }
.rank-silver { color: #9aa5b1; }
.rank-bronze { color: #cd7f32; }
.leaderboard-username { font-weight: 600; }
.leaderboard-wins { color: var(--accent-label); font-weight: 700; }

.leaderboard-empty,
.leaderboard-error,
.leaderboard-loading {
  text-align: center;
  padding: 40px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.leaderboard-error { color: var(--text-danger); }

/* ── Page headings ── */
.page-heading {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.page-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ── Blog ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .blog-card { border: 1px solid var(--border-card); }
.blog-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

.blog-card-date { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.blog-card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 7px; line-height: 1.4; }
.blog-card-excerpt { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.blog-card-link { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--accent-label); font-weight: 600; }

/* ── Prose ── */
.prose {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 680px;
}

.prose h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 26px 0 10px;
  letter-spacing: -0.3px;
}

.prose h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 18px 0 8px;
}

.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 20px; margin: 10px 0; }
.prose li { margin-bottom: 7px; }
.prose a { color: var(--accent-label); }

/* ── Nav active ── */
.nav-active { color: var(--text-nav-active) !important; font-weight: 600; }

/* ── Paywall block ── */
.paywall-block {
  background: var(--bg-danger);
  border: 1px solid var(--border-danger);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}

.paywall-block h3 { font-size: 15px; font-weight: 700; color: var(--text-danger); margin-bottom: 8px; }
.paywall-block p { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.5; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .container { width: 90%; }
  .nav-inner { width: 90%; }
  .footer-inner { width: 90%; }
}

@media (max-width: 768px) {
  .container { width: 100%; padding: 0 16px; }
  .nav-inner { width: 100%; padding: 0 16px; }
  .footer-inner { width: 100%; padding: 0 16px; }
  .content-sidebar { display: none; }
  .ad-slot-top { height: 60px; }
  .nav-links { display: none; }
  .word-tiles { gap: 7px; }
  .letter-tile { width: 48px; height: 56px; font-size: 21px; }
  .game-buttons { gap: 7px; }
  .btn { font-size: 11px; padding: 9px 6px; }
  .game-card { padding: 18px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .cookie-consent { flex-direction: column; align-items: flex-start; padding: 12px 16px; }
}

@media (max-width: 400px) {
  .letter-tile { width: 42px; height: 50px; font-size: 19px; }
  .game-card { padding: 14px; }
  .word-tiles { gap: 5px; }
}
/* ── How to play strip ── */
.how-to-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.how-to-step {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-ghost);
}

[data-theme="dark"] .how-to-step { border: 1px solid var(--border-card); }
.how-to-icon { font-size: 24px; margin-bottom: 8px; }
.how-to-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.how-to-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

/* ── Mid ad ── */
.ad-slot-mid {
  height: 90px;
  margin: 14px auto;
  width: 100%;
}

/* ── Why section ── */
.why-section { margin-top: 14px; }

.section-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.why-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-ghost);
}

[data-theme="dark"] .why-card { border: 1px solid var(--border-card); }
.why-icon { font-size: 22px; margin-bottom: 8px; }
.why-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.why-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

/* ── Blog teasers ── */
.blog-teaser-section { margin-top: 14px; }

.blog-teaser-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.blog-teaser-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-ghost);
  text-decoration: none;
  display: block;
  transition: all var(--transition);
}

[data-theme="dark"] .blog-teaser-card { border: 1px solid var(--border-card); }
.blog-teaser-card:hover { transform: translateY(-2px); opacity: 1; }
.blog-teaser-date { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.blog-teaser-title { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.4; margin-bottom: 10px; }
.blog-teaser-link { font-size: 12px; color: var(--accent-label); font-weight: 600; }

/* ── FAQ ── */
.faq-section { margin-top: 14px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }

.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-ghost);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .faq-item { border: 1px solid var(--border-card); }

.faq-q {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-q::after {
  content: '+';
  font-size: 18px;
  color: var(--accent-label);
  font-weight: 400;
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-open .faq-q::after { content: '−'; }

.faq-a {
  display: none;
  padding: 0 16px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  border-top: 1px solid var(--border-ghost);
}

[data-theme="dark"] .faq-a { border-top: 1px solid var(--border-card); }
.faq-open .faq-a { display: block; }

/* ── Sidebar tip card ── */
.sidebar-tip-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-ghost);
}

[data-theme="dark"] .sidebar-tip-card { border: 1px solid var(--border-card); }

.sidebar-tip-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.sidebar-tip-list {
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.9;
}

.sidebar-mode-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-label);
  margin-bottom: 3px;
}

.sidebar-mode-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Responsive additions ── */
@media (max-width: 768px) {
  .how-to-strip { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .blog-teaser-grid { grid-template-columns: 1fr; }
}
/* ── Mobile keyboard scroll fix ── */
@media (max-width: 768px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }
  .page-wrapper {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}