/* Word Unscrambler — purple/orange playful theme, mobile-first */
:root {
  --purple: #6d28d9;
  --purple-dark: #4c1d95;
  --purple-light: #ede9fe;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --ink: #1f2430;
  --muted: #5b6070;
  --bg: #faf9ff;
  --card: #ffffff;
  --line: #e6e1f5;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(76, 29, 149, 0.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
}
a { color: var(--purple); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: #fff;
  padding: 18px 0 26px;
}
.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo .tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: var(--orange);
  border-radius: 9px;
  font-size: 1.05rem;
  box-shadow: 0 3px 0 var(--orange-dark);
}
.main-nav { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.main-nav a { color: #e9e4ff; text-decoration: none; font-size: 0.95rem; font-weight: 600; }
.main-nav a:hover { color: #fff; text-decoration: underline; }

/* Hero + tool */
.hero { text-align: center; padding: 30px 0 6px; }
.hero h1 { font-size: 2.1rem; line-height: 1.15; color: var(--purple-dark); }
.hero h1 .accent { color: var(--orange); }
.hero p { color: var(--muted); max-width: 620px; margin: 10px auto 0; }
.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 22px 0 8px;
}
.tool-card label { display: block; font-weight: 700; margin-bottom: 8px; }
.tool-row { display: flex; gap: 10px; flex-direction: column; }
#letters-input {
  flex: 1;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: none;
  text-align: center;
  background: #fffeff;
}
#letters-input:focus { border-color: var(--purple); box-shadow: 0 0 0 4px var(--purple-light); }
.btn {
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 12px;
  padding: 14px 22px;
  transition: transform 0.05s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 4px 0 var(--orange-dark); }
.btn-primary:hover { background: var(--orange-dark); }
.btn-ghost { background: var(--purple-light); color: var(--purple-dark); }
.hint { color: var(--muted); font-size: 0.9rem; margin-top: 10px; text-align: center; }
.hint code {
  background: var(--purple-light);
  color: var(--purple-dark);
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 700;
}

/* Results */
.results-status { margin: 18px 2px 6px; color: var(--muted); }
.results-status.error { color: #b91c1c; font-weight: 600; }
.word-group { margin: 18px 0; }
.word-group h3 {
  font-size: 1.05rem;
  color: var(--purple-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.group-count {
  background: var(--purple);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}
.word-list { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip {
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-bottom-width: 3px;
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.word-chip:hover { border-color: var(--purple); color: var(--purple-dark); background: var(--purple-light); }
.word-chip.copied { background: var(--orange); border-color: var(--orange-dark); color: #fff; }

/* Content sections */
.content { padding: 18px 0 8px; }
.content section { margin: 26px 0; }
.content h2 { font-size: 1.45rem; color: var(--purple-dark); margin-bottom: 10px; }
.content h3 { font-size: 1.1rem; color: var(--purple-dark); margin: 14px 0 6px; }
.content p, .content li { color: #333848; }
.content ul, .content ol { padding-left: 22px; margin: 8px 0; }
.content li { margin: 5px 0; }
.steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.steps li {
  position: relative;
  padding: 12px 14px 12px 52px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 10px 0;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 12px; top: 12px;
  width: 28px; height: 28px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
}
.two-col { display: grid; gap: 14px; }
.tip-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--orange);
  border-radius: 12px;
  padding: 16px 18px;
}
.tip-card h3 { margin-top: 0; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 10px 0;
}
.faq-item h3 { margin: 0 0 4px; }
.mail-btn {
  display: inline-block;
  margin-top: 8px;
  background: var(--orange);
  color: #fff !important;
  font-weight: 800;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--orange-dark);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--purple-dark);
  color: #fff;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: var(--shadow);
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Footer */
.site-footer {
  background: var(--purple-dark);
  color: #ddd3ff;
  margin-top: 44px;
  padding: 28px 0 34px;
}
.site-footer a { color: #fff; text-decoration: none; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.site-footer p { font-size: 0.9rem; color: #c4b5fd; }

@media (min-width: 640px) {
  .tool-row { flex-direction: row; }
  #letters-input { text-align: left; }
  .hero h1 { font-size: 2.7rem; }
  .two-col { grid-template-columns: 1fr 1fr; }
}
