:root {
  color-scheme: light;
  --bg: #f7f7fb;
  --card: #ffffff;
  --text: #1b1b1f;
  --muted: #5c5c6a;
  --accent: #2d6cdf;
  --accent-dark: #1c4fa8;
  --border: #e2e2ef;
  --shadow: 0 10px 30px rgba(26, 30, 41, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

body.word-finder header {
  background: linear-gradient(120deg, #1e3a8a, #2563eb, #60a5fa);
}

body.anagram-finder header,
body.word-scramble header,
body.info-page header {
  background: linear-gradient(120deg, #0f172a, #1d4ed8, #60a5fa);
}

header {
  color: #fff;
  padding: 48px 20px 64px;
  text-align: center;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto 24px;
  padding: 0 20px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.burger {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
  position: relative;
}

.burger span::before,
.burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

.burger span::before {
  top: -6px;
}

.burger span::after {
  top: 6px;
}

.menu {
  position: absolute;
  right: 20px;
  top: 72px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  min-width: 180px;
  display: none;
  z-index: 10;
}

.menu a {
  display: block;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
}

.menu a:hover {
  background: #f1f5f9;
}

.menu.is-open {
  display: block;
}

header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 10px;
}

header p {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.05rem;
  opacity: 0.9;
}

main {
  max-width: 1100px;
  margin: -40px auto 60px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
}

h2 {
  font-size: 1.25rem;
  margin-top: 0;
}

label {
  font-weight: 600;
  display: block;
  margin: 16px 0 6px;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

select {
  background: #fff;
}

pre {
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-height: 120px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-weight: 600;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.row > div {
  flex: 1 1 140px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eef2ff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  color: #1e3a8a;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  padding: 12px 20px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s ease;
}

.cta:hover {
  background: var(--accent-dark);
}

.result-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.result-group {
  margin-top: 18px;
}

.result-group h3 {
  margin: 12px 0;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-list li {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  background: #f8fafc;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 6px;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 30px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.footer-links a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  main {
    margin-top: -30px;
  }
}
