/* WordWiz – Magic with Words */
:root {
  --navy: #1b2342;
  --navy-2: #2a3460;
  --purple: #6c3fd1;
  --purple-2: #8a63e6;
  --purple-soft: #f1ecfd;
  --gold: #ffba00;
  --gold-soft: #fff6dc;
  --ink: #1b2342;
  --muted: #5d6481;
  --line: #e4e6f0;
  --bg: #ffffff;
  --bg-2: #f7f7fb;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(27, 35, 66, 0.08);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 88px; gap: 16px; }
.brand img { height: 62px; width: auto; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a, .nav button {
  white-space: nowrap;
  font: 700 15px var(--font); color: var(--navy); background: none; border: 0;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: var(--purple-soft); color: var(--purple); text-decoration: none; }
.nav .menu { position: relative; }
.menu-panel {
  display: none; grid-auto-flow: column; position: absolute; right: 0; top: 50px; width: 560px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; grid-template-columns: 1fr 1fr; gap: 2px;
}
.menu.open .menu-panel { display: grid; }
.menu-panel a { font-weight: 600; font-size: 15px; padding: 8px 10px; }
.burger { display: none; margin-left: auto; background: none; border: 0; color: var(--navy); cursor: pointer; padding: 6px 10px; border-radius: 10px; }
.burger:hover { background: var(--purple-soft); }

/* ---------- hero / tool box ---------- */
.hero {
  background: radial-gradient(1200px 400px at 50% -120px, var(--purple-soft), transparent 70%), var(--bg);
  padding: 38px 0 18px;
  text-align: center;
}
.hero h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.5px; }
.hero h1 .spark { color: var(--gold); }
.hero p.lead { color: var(--muted); font-size: 18px; margin: 0 auto 22px; max-width: 680px; }

.tool {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  padding: 22px; max-width: 760px; margin: 0 auto; text-align: left;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 800; font-size: 14px; color: var(--navy-2); text-transform: uppercase; letter-spacing: 0.6px; }
.field .hint { font-size: 13px; color: var(--muted); }
.input, select.input {
  font: 700 20px var(--font); color: var(--navy);
  border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input.big { font-size: 26px; letter-spacing: 3px; text-transform: uppercase; padding: 14px 16px; }
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 4px var(--purple-soft); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.row .input { font-size: 17px; padding: 10px 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin: 4px 0 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }

.advanced { margin: 4px 0 14px; }
.advanced summary { cursor: pointer; font-weight: 800; color: var(--purple); list-style: none; font-size: 15px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "＋ "; }
.advanced[open] summary::before { content: "－ "; }
.advanced .row { margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 18px var(--font); color: #fff; background: var(--purple);
  border: 0; border-radius: 12px; padding: 14px 22px; cursor: pointer; width: 100%;
  box-shadow: 0 6px 16px rgba(108, 63, 209, 0.28); transition: transform .08s, background .15s;
}
.btn:hover { background: var(--purple-2); }
.btn:active { transform: translateY(1px); }
.btn .star { color: var(--gold); }

/* wordle tiles */
.tiles { display: flex; gap: 8px; }
.tiles input {
  width: 100%; max-width: 64px; aspect-ratio: 1; text-align: center; text-transform: uppercase;
  font: 900 26px var(--font); border-radius: 10px; border: 2px solid var(--line); color: #fff; outline: none;
}
.tiles.green input { background: #fff; color: var(--navy); }
.tiles.green input:not(:placeholder-shown) { background: #3fa45b; border-color: #3fa45b; color: #fff; }
.tiles.yellow input { background: #fff; color: var(--navy); font-size: 17px; }
.tiles.yellow input:not(:placeholder-shown) { background: #e2b928; border-color: #e2b928; color: #fff; }
.tiles input:focus { border-color: var(--purple); }

/* ---------- results ---------- */
.results { max-width: 1080px; margin: 26px auto 0; text-align: left; }
.summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.summary h2 { margin: 0; font-size: 22px; }
.sorter { display: flex; gap: 6px; flex-wrap: wrap; }
.sorter button {
  font: 700 14px var(--font); border: 1px solid var(--line); background: #fff; color: var(--navy);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.sorter button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.group { margin: 18px 0 8px; }
.group h3 { font-size: 18px; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.group h3 .count { font-size: 13px; font-weight: 800; color: var(--purple); background: var(--purple-soft); border-radius: 999px; padding: 2px 10px; }
.words { display: flex; flex-wrap: wrap; gap: 8px; }
.word {
  position: relative; display: inline-flex; align-items: center; gap: 2px;
  font: 800 16px var(--font); letter-spacing: 1px; text-transform: uppercase;
  color: var(--navy); background: var(--gold-soft); border: 1px solid #f3dfa4;
  border-radius: 9px; padding: 6px 12px; transition: transform .08s, background .15s;
}
.word:hover { background: #ffe9ad; text-decoration: none; transform: translateY(-1px); }
.word sub { font-size: 11px; font-weight: 800; color: var(--purple); margin-left: 4px; letter-spacing: 0; }
.word.exact { background: var(--purple); color: #fff; border-color: var(--purple); }
.word.exact sub { color: var(--gold); }
.more { font: 800 14px var(--font); color: var(--purple); background: var(--purple-soft); border: 0; border-radius: 9px; padding: 7px 12px; cursor: pointer; }
.empty, .loading { text-align: center; color: var(--muted); padding: 24px; font-weight: 700; }
.note { background: var(--purple-soft); border-radius: 12px; padding: 12px 16px; font-size: 15px; margin: 10px 0; }
.plural-card { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; padding: 10px 0; }
.plural-card .from, .plural-card .to { font: 900 30px var(--font); text-transform: uppercase; letter-spacing: 2px; }
.plural-card .to { color: var(--purple); }
.plural-card .arrow { color: var(--gold); font-size: 30px; }

/* ---------- content ---------- */
.content { padding: 30px 0 10px; }
.content h2 { font-size: 26px; margin: 28px 0 10px; }
.content p, .content li { color: #3b4263; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0 10px; }
.card {
  display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff;
  transition: border-color .15s, transform .08s, box-shadow .15s; color: var(--navy);
}
.card:hover { border-color: var(--purple); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.card strong { display: block; font-size: 17px; }
.card span { font-size: 14px; color: var(--muted); }
.card .ico { font-size: 22px; color: var(--gold); line-height: 1; margin-bottom: 6px; display: block; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 800; font-size: 17px; }
.faq p { margin: 8px 0 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: #c9cde0; margin-top: 50px; padding: 36px 0 26px; font-size: 15px; }
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; grid-template-columns: 1.2fr 2fr; gap: 30px; }
.site-footer .links { columns: 3 160px; }
.site-footer .links a { display: block; padding: 3px 0; font-weight: 600; }
.site-footer .tag { color: var(--gold); font-weight: 800; letter-spacing: 2px; text-transform: uppercase; font-size: 13px; }
.site-footer .copy { border-top: 1px solid #333c63; margin-top: 24px; padding-top: 16px; font-size: 13px; color: #9ea4c2; }

/* ---------- collapse the menu on tablets and phones ---------- */
@media (max-width: 1100px) {
  .burger { display: inline-block; font-size: 26px !important; }
  .nav .menu > button, .nav > a { display: none; }
  .nav.open { position: absolute; top: 88px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 20px 16px; display: block; }
  .nav.open .menu-panel { display: grid; position: static; width: auto; box-shadow: none; border: 0; padding: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; }
  .nav.open .menu-panel a { white-space: normal; }
}

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .brand img { height: 50px; }
  .tool { padding: 16px; border-radius: 16px; }
  .input.big { font-size: 22px; }
  .site-footer .cols { grid-template-columns: 1fr; }
}

/* ---------- dictionary & thesaurus ---------- */
.entry { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 24px 26px; max-width: 860px; margin: 0 auto; }
.entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; border-bottom: 2px solid var(--purple-soft); padding-bottom: 10px; margin-bottom: 8px; }
.entry-word { margin: 0; font-size: clamp(30px, 5vw, 40px); font-weight: 900; color: var(--navy); }
.entry-sub { margin: 0; color: var(--muted); font-weight: 700; }
.listen { font: 800 14px var(--font); color: var(--purple); background: var(--purple-soft); border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.pos-block { margin-top: 14px; }
.pos { display: inline-block; font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: #fff; background: var(--purple); border-radius: 8px; padding: 3px 10px; margin: 10px 0 4px; }
.senses { margin: 6px 0 0; padding-left: 24px; }
.sense { margin: 10px 0 14px; }
.sense::marker { color: var(--purple); font-weight: 900; }
.def { margin: 0; font-weight: 700; color: var(--ink); font-size: 18px; }
.example { margin: 4px 0 0; color: var(--muted); font-style: italic; }
.chiprow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.chiplabel { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-right: 4px; }
.chip { font-weight: 800; font-size: 15px; color: var(--navy); background: var(--gold-soft); border: 1px solid #f3dfa4; border-radius: 999px; padding: 3px 12px; }
.chip:hover { background: #ffe9ad; text-decoration: none; }
.crosslink { margin: 18px 0 0; font-weight: 800; }
.source { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

/* "All tools" button stands out */
.nav .menu > button { background: var(--purple); color: #fff; border-radius: 10px; padding: 9px 16px; margin-left: 6px; box-shadow: 0 4px 12px rgba(108, 63, 209, 0.25); }
.nav .menu > button:hover, .nav .menu.open > button { background: var(--purple-2); color: #fff; }

/* ---------- swipeable tool strip (tablets & phones) ---------- */
.toolstrip { display: none; }
@media (max-width: 1100px) {
  .toolstrip {
    display: block; position: sticky; top: 88px; z-index: 40;
    background: #fff; border-bottom: 1px solid var(--line);
  }
  .toolstrip::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 48px; pointer-events: none; background: linear-gradient(to right, rgba(255,255,255,0), #fff); }
  .toolstrip-inner {
    display: flex; gap: 8px; overflow-x: auto; padding: 10px 20px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; 
  }
  .toolstrip-inner::-webkit-scrollbar { display: none; }
  .toolstrip a {
    flex: 0 0 auto; white-space: nowrap;
    font: 800 14px var(--font); color: var(--navy); background: var(--purple-soft);
    border-radius: 999px; padding: 7px 14px;
  }
  .toolstrip a:hover { text-decoration: none; background: #e4dafb; }
  .toolstrip a.on { background: var(--purple); color: #fff; }
}

/* ---------- word pages (meaning / synonyms / rhymes / unscramble) ---------- */
.crumbs { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs span { color: var(--navy); }
.tool.mini { display: flex; gap: 10px; padding: 12px; max-width: 560px; }
.tool.mini .input { font-size: 18px; padding: 10px 14px; }
.tool.mini .btn { width: auto; white-space: nowrap; padding: 10px 18px; font-size: 16px; }
.content.first { padding-top: 6px; }
.intro { font-size: 18px; max-width: 860px; margin: 0 auto 18px; color: #3b4263; }
.syn-sense { border-bottom: 1px solid var(--line); padding: 12px 0; margin: 0; }
.syn-sense:last-of-type { border-bottom: 0; }
.pos-mini { display: inline-block; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .8px; color: var(--purple); background: var(--purple-soft); border-radius: 6px; padding: 2px 8px; margin-right: 6px; vertical-align: middle; }
.seealso { max-width: 860px; margin: 24px auto 0; }
.seealso h2 { font-size: 22px; }
.az { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.az a, .az span { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 900; }
.az a { background: var(--purple); color: #fff; }
.az a:hover { background: var(--purple-2); text-decoration: none; }
.az span { background: var(--bg-2); color: #c3c7d6; }
.words a.word[href] { text-transform: none; letter-spacing: 0.2px; }
@media (max-width: 760px) { .tool.mini { flex-direction: column; } .tool.mini .btn { width: 100%; } }
