:root {
  --easy:        #34a853;
  --easy-bg:     #e6f4ea;
  --medium:      #f9ab00;
  --medium-bg:   #fef9e7;
  --hard:        #ea4335;
  --hard-bg:     #fce8e6;
  --neutral:     #9aa0a6;
  --neutral-bg:  #f1f3f4;
  --accent:      #1a73e8;
  --text:        #1a1a1a;
  --muted:       #5f6368;
  --border:      #dadce0;
  --radius-pill: 20px;
  --radius-card: 12px;
}

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  background: #fff;
  color: var(--text);
  padding: 24px 16px 48px;
}

/* Extra top padding when hub nav is injected */
body:has(.site-nav) {
  padding-top: 72px;
}

.container { max-width: 540px; margin: 0 auto; }

header { text-align: center; margin-bottom: 28px; }

h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.5px;
}

.tagline { font-size: 0.9rem; color: var(--muted); margin: 0; }
.intro { font-size: 0.9rem; color: var(--muted); margin: 0.5rem 0 0; line-height: 1.5; max-width: 560px; }

/* ── Difficulty row ── */
.difficulty-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

.pill {
  border-width: 2px;
  border-style: solid;
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  transition: background 0.15s, transform 0.1s;
  line-height: 1;
}
.pill:active { transform: scale(0.95); }

.pill--easy   { border-color: var(--easy);    color: var(--easy);    }
.pill--medium { border-color: var(--medium);  color: var(--medium);  }
.pill--hard   { border-color: var(--hard);    color: var(--hard);    }
.pill--any    { border-color: var(--neutral); color: var(--neutral); }

.pill--easy.active   { background: var(--easy-bg);    }
.pill--medium.active { background: var(--medium-bg);  }
.pill--hard.active   { background: var(--hard-bg);    }
.pill--any.active    { background: var(--neutral-bg); }

.btn-dice {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  line-height: 1;
  transition: transform 0.15s;
}
.btn-dice:hover  { transform: rotate(20deg) scale(1.1); }
.btn-dice:active { transform: scale(0.9); }

/* ── Category row ── */
.category-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cat-pill {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1;
}
.cat-pill:active { transform: scale(0.95); }
.cat-pill--active {
  background: #e8f0fe;
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Generate button ── */
.btn-generate {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.3);
  transition: background 0.15s, transform 0.1s;
}
.btn-generate:hover  { background: #1557b0; }
.btn-generate:active { transform: scale(0.98); }
.btn-generate:disabled { background: #a8c4f0; cursor: not-allowed; box-shadow: none; }

/* ── Result card ── */
.result-card {
  padding: 20px 16px;
  border-radius: var(--radius-card);
  border: 2px solid var(--border);
  background: #f8f9fa;
  text-align: center;
  margin-bottom: 12px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-card--easy   { border-color: var(--easy);    background: var(--easy-bg);   }
.result-card--medium { border-color: var(--medium);  background: var(--medium-bg); }
.result-card--hard   { border-color: var(--hard);    background: var(--hard-bg);   }

.result-card__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
  min-height: 1em;
}
.result-card--easy   .result-card__label { color: #1e7e34; }
.result-card--medium .result-card__label { color: #b06000; }
.result-card--hard   .result-card__label { color: #c0392b; }

.result-card__word {
  font-size: clamp(1.8rem, 8vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}

@keyframes wordIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0);   }
}
.word-animate { animation: wordIn 0.2s ease-out; }

/* ── Copy button ── */
.btn-copy {
  display: block;
  width: 100%;
  padding: 10px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 20px;
  transition: border-color 0.15s;
}
.btn-copy:hover { border-color: #aaa; }

/* ── Word examples + use cases ── */
.word-examples { margin-top: 40px; }
.word-examples h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 16px; }
.word-examples h2:not(:first-child) { margin-top: 32px; }

.word-examples__group { margin-bottom: 24px; }
.word-examples__group h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}
.word-examples__group p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 10px;
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.word-list li {
  background: var(--neutral-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.8rem;
  color: var(--text);
}

.use-cases {
  display: grid;
  gap: 16px;
  margin-bottom: 8px;
}
.use-case h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 4px;
}
.use-case p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

@media (min-width: 600px) {
  .use-cases { grid-template-columns: 1fr 1fr; }
}

/* ── FAQ ── */
.faq { margin-top: 40px; }
.faq h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }

.faq details {
  border-bottom: 1px solid #e8eaed;
  padding: 12px 0;
}
.faq summary {
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '+ '; color: var(--muted); }
details[open] summary::before { content: '− '; }
.faq details p {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Footer ── */
footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e8eaed;
  text-align: center;
  font-size: 0.8rem;
  color: #9aa0a6;
}

@media (min-width: 600px) {
  .btn-generate {
    display: inline-block;
    width: auto;
    padding: 12px 40px;
  }
  .btn-copy {
    display: inline-block;
    width: auto;
    padding: 10px 32px;
  }
  main { text-align: center; }
  .result-card, .difficulty-row { text-align: left; }
}

/* Dark mode — activated by data-theme="dark" on <html> */
[data-theme="dark"] {
  --text:       #e2e8f0;
  --muted:      #9aa0a6;
  --border:     #2a2a3e;
  --neutral-bg: #2a2a3e;
  --accent:     #4a9eff;
  --easy-bg:    #1a3a2a;
  --medium-bg:  #3a2a0a;
  --hard-bg:    #3a1a1a;
}
[data-theme="dark"] body { background: #0f0f1a; }
[data-theme="dark"] .result-card { background: #1a1a2e; }
[data-theme="dark"] .cat-pill--active { background: #1a2a4a; }
[data-theme="dark"] .btn-copy { background: #1a1a2e; border-color: var(--border); }
[data-theme="dark"] .btn-copy:hover { border-color: #4a4a5e; }
[data-theme="dark"] .word-list li { background: #1a1a2e; }
[data-theme="dark"] .faq details { border-bottom-color: #2a2a3e; }
[data-theme="dark"] footer { border-top-color: #2a2a3e; }
