*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:       #378ADD;
  --blue-dark:  #185FA5;
  --blue-bg:    #E6F1FB;
  --blue-text:  #0C447C;
  --border:     rgba(0,0,0,0.12);
  --text:       #1a1a1a;
  --text-muted: #666;
  --text-hint:  #999;
  --bg:         #f5f4f0;
  --surface:    #ffffff;
  --surface2:   #f0eeea;
  --radius-sm:  8px;
  --radius-md:  12px;
}

body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

.page { max-width: 740px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* ── Top bar ── */
.top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2.5rem; flex-wrap: wrap; gap: 12px; }
.logo { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-hint); text-decoration: none; }
.logo span { color: var(--blue); }
.nav { display: flex; gap: 1.5rem; }
.nav a { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-hint); text-decoration: none; }
.nav a:hover { color: var(--blue); }

/* ── Language picker ── */
.lang-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 2rem; }
.lang-btn {
  height: 30px; padding: 0 12px; border-radius: 99px;
  border: 0.5px solid var(--border); background: var(--surface);
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--text-muted); cursor: pointer; transition: all .12s;
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
}
.lang-btn:hover { background: var(--surface2); }
.lang-btn.active { background: var(--blue-bg); border-color: var(--blue); color: var(--blue-text); }

/* ── Hero ── */
.hero { margin-bottom: 1.5rem; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); font-weight: 800; line-height: 1.1; margin-bottom: .4rem; }
.hero h1 em { font-style: normal; color: var(--blue); }
.hero p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ── Search ── */
.search-row { display: flex; gap: 8px; margin-bottom: 1rem; }
.letter-input {
  flex: 1; min-width: 0; height: 54px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border); background: var(--surface);
  font-family: 'DM Mono', monospace; font-size: 22px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  padding: 0 1rem; color: var(--text); outline: none; transition: border-color .15s;
}
.letter-input:focus { border-color: var(--blue); }
.letter-input::placeholder { font-size: 14px; letter-spacing: 0; font-family: 'DM Sans', sans-serif; color: var(--text-hint); }
.btn-search {
  height: 54px; padding: 0 1.5rem; border-radius: var(--radius-md);
  border: none; background: var(--blue); color: #fff;
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.btn-search:hover { background: var(--blue-dark); }
.btn-search:disabled { background: var(--text-hint); cursor: not-allowed; }

/* ── Status ── */
.status { font-size: 13px; color: var(--text-hint); margin-bottom: 1rem; min-height: 20px; }
.status.error { color: #c0392b; }

/* ── Filters ── */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filter-btn {
  height: 28px; padding: 0 12px; border-radius: 99px;
  border: 0.5px solid var(--border); background: var(--surface);
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--text-muted); cursor: pointer; transition: all .12s;
}
.filter-btn:hover, .filter-btn.active { background: var(--blue-bg); border-color: var(--blue); color: var(--blue-text); }

/* ── Results ── */
.results-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-hint); margin-bottom: .75rem; }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.word-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-md); padding: .7rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  cursor: default; transition: border-color .12s, background .12s;
}
.word-card:hover { border-color: var(--blue); background: var(--blue-bg); }
.word-card .word { font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.word-card .pts { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--blue-bg); color: var(--blue-text); }
.word-card .pts.hi { background: #B5D4F4; color: #0C447C; }
.empty { grid-column: 1 / -1; text-align: center; padding: 2.5rem; color: var(--text-hint); font-size: 14px; }

/* ── Stats ── */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-md); padding: .7rem 1rem; }
.stat-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-hint); margin-bottom: 4px; }
.stat-val { font-family: 'DM Mono', monospace; font-size: 18px; font-weight: 500; }

/* ── Spinner ── */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Content sections ── */
.content-section { margin-top: 3rem; }
.content-section h2 { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 1rem; }
.content-section h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 1.25rem 0 .4rem; }
.content-section p { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: .75rem; }
.content-section ul { padding-left: 1.25rem; margin-bottom: .75rem; }
.content-section li { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: .3rem; }
.tip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 1rem; }
.tip-card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-md); padding: 1rem 1.1rem; }
.tip-card .tip-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: .3rem; }
.tip-card .tip-body { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.tip-card .tip-example { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--blue-dark); margin-top: .4rem; }

/* ── FAQ ── */
.faq { display: flex; flex-direction: column; gap: 6px; margin-top: 1rem; }
.faq-item {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-md); padding: .9rem 1.1rem;
}
.faq-item summary {
  cursor: pointer; font-size: 14px; font-weight: 700; color: var(--text);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 18px; color: var(--text-hint); flex-shrink: 0;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-top: .6rem;
}

/* ── Footer ── */
footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-hint); text-align: center; line-height: 1.8; }
.footer-contact { display: inline-block; margin-top: .25rem; }
.footer-contact a { color: var(--text-hint); text-decoration: underline; }
.footer-contact a:hover { color: var(--blue); }
.footer-links { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; margin-top: .9rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.footer-links a:hover { color: var(--blue); }

/* ── Static content pages ── */
.static-page { max-width: 720px; }
.static-page .page-header { margin-bottom: 1.75rem; }
.static-page .page-header h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; line-height: 1.2; margin-bottom: .35rem; }
.static-page .page-header .updated { font-size: 12px; color: var(--text-hint); letter-spacing: .04em; }
.static-page h2 { font-size: 18px; font-weight: 800; margin: 1.75rem 0 .6rem; color: var(--text); }
.static-page h3 { font-size: 15px; font-weight: 700; margin: 1.25rem 0 .4rem; color: var(--text); }
.static-page p { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: .9rem; }
.static-page ul { padding-left: 1.25rem; margin-bottom: 1rem; }
.static-page li { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: .35rem; }
.static-page a { color: var(--blue-dark); }
.static-page a:hover { color: var(--blue); }

/* ── Consent banner ── */
.consent-banner {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%);
  width: calc(100% - 2rem); max-width: 640px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  padding: .9rem 1rem; display: flex; flex-wrap: wrap; gap: .75rem 1rem;
  align-items: center; justify-content: space-between; z-index: 1000;
  font-size: 13px; line-height: 1.55;
}
.consent-banner[hidden] { display: none; }
.consent-text { flex: 1 1 240px; color: var(--text-muted); margin: 0; }
.consent-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.consent-link { color: var(--blue-dark); text-decoration: underline; font-size: 13px; font-weight: 700; }
.consent-link:hover { color: var(--blue); }
.consent-accept {
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: none; background: var(--blue); color: #fff;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.consent-accept:hover { background: var(--blue-dark); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .page { padding: 1.5rem 1rem 3rem; }
  .top-bar { margin-bottom: 1.75rem; }
  .lang-row { margin-bottom: 1.5rem; }
  .word-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .letter-input { font-size: 18px; letter-spacing: .15em; }
  .btn-search { padding: 0 1.1rem; font-size: 14px; }
  .stat { padding: .6rem .75rem; }
  .stat-label { font-size: 10px; letter-spacing: .06em; }
  .stat-val { font-size: 16px; }
}

@media (max-width: 360px) {
  .word-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); }
  .word-card { padding: .55rem .65rem; }
  .word-card .word { font-size: 13px; }
}
