/* GoUnscramble: one stylesheet for every page. */
:root {
  --bg: #F4F5F7;
  --ink: #111111;
  --muted: #555555;
  --line: #E3E5EA;
  --card: #FFFFFF;
  --yellow: #FFD23F;
  --green: #2FBF71;
  --green-dark: #27A862;
  --display: 'Fredoka', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--ink); }
a:hover { color: var(--muted); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
main { flex: 1; padding-bottom: 72px; }

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.5px; line-height: 1.1; }
h1 { font-size: clamp(36px, 7vw, 64px); letter-spacing: -1px; }
h2 { font-size: clamp(26px, 4vw, 36px); }
h3 { font-size: 22px; letter-spacing: 0; }
p { margin: 0; }

/* Header and footer: identical on every page. */
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 20px; padding-bottom: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -0.5px; color: var(--ink); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.nav a { font-weight: 700; text-decoration: none; padding: 10px 0; border-bottom: 3px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--yellow); }
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 32px; padding-bottom: 32px; color: var(--muted); font-size: 15px;
}
.foot-brand { display: flex; align-items: center; gap: 10px; }
.site-footer .nav a { font-weight: 600; color: var(--muted); }

/* Hero and tool panel. */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 28px; padding-top: 48px; }
.hero h1 { max-width: 760px; }
.lede { font-size: 20px; line-height: 1.5; color: var(--muted); max-width: 560px; }
.panel {
  width: 100%; max-width: 760px; background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; padding: 24px; text-align: left; display: flex; flex-direction: column; gap: 12px;
}
label { font-weight: 700; font-size: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.hint { font-size: 15px; color: var(--muted); }

.field {
  width: 100%; height: 48px; padding: 0 14px; font-family: var(--display); font-weight: 500; font-size: 18px;
  color: var(--ink); background: var(--bg); border: 2px solid var(--ink); border-radius: 12px;
}
.field.big { flex: 1 1 260px; width: auto; min-width: 0; height: 56px; padding: 0 20px; font-size: 24px; letter-spacing: 1px; border-radius: 14px; }
.field.area { height: auto; min-height: 220px; padding: 14px; font-family: var(--body); font-weight: 400; font-size: 18px; line-height: 1.5; resize: vertical; }
select.field { font-family: var(--body); font-weight: 600; font-size: 17px; }

.btn {
  min-height: 56px; padding: 0 32px; font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--ink);
  background: var(--green); border: 2px solid var(--ink); border-radius: 14px; cursor: pointer;
}
.btn:hover { background: var(--green-dark); }
.btn.alt { min-height: 48px; padding: 0 20px; font-size: 18px; background: #FFFFFF; }
.btn.alt:hover { background: var(--bg); }

.more { padding-top: 4px; }
.more summary {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; background: #FFFFFF;
  border: 2px solid var(--ink); border-radius: 14px; font-family: var(--display); font-weight: 600; font-size: 18px;
  cursor: pointer; list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more[open] summary svg { transform: rotate(180deg); }
.opts { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; }
.dict-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.dict-row .field { flex: 0 1 340px; min-width: 0; width: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.fgroup { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

/* Example row on the home page. */
.example {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 24px;
  background: none; border: 0; padding: 8px; border-radius: 16px; cursor: pointer; font: inherit; color: inherit;
}
.example:hover { background: rgba(255, 210, 63, 0.18); }
.letters { display: flex; gap: 8px; }
.ltile {
  width: 48px; height: 48px; border-radius: 12px; background: var(--yellow); border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 26px;
}
.arrow { font-family: var(--display); font-weight: 600; font-size: 28px; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 8px 18px; border-radius: 999px; background: #FFFFFF; border: 2px solid var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 20px; text-transform: uppercase;
}

/* Results. */
.results { width: 100%; max-width: 760px; text-align: left; display: flex; flex-direction: column; gap: 20px; }
.results:empty { display: none; }
.note { font-size: 17px; color: var(--muted); }
.note.strong { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--ink); }
.note.error { color: #A12020; font-weight: 700; }
.group { display: flex; flex-direction: column; gap: 10px; }
.group h3 { font-size: 20px; }
.count { color: var(--muted); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 999px; background: #FFFFFF; border: 2px solid var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 19px; text-transform: uppercase;
}

/* Cards (home page and tools page). */
.block { display: flex; flex-direction: column; gap: 28px; margin-top: 72px; }
.block.narrow { max-width: 720px; gap: 12px; }
.block.narrow p { font-size: 18px; color: var(--muted); }
.cards { display: flex; flex-wrap: wrap; gap: 20px; }
.card {
  flex: 1 1 300px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 24px; display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: var(--ink);
}
a.card:hover { border-color: var(--ink); color: var(--ink); }
.card p { color: var(--muted); font-size: 16px; line-height: 1.5; }
.tile {
  width: 52px; height: 52px; border-radius: 14px; background: var(--ink); color: var(--yellow);
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 20px;
}

/* Text pages. */
.prose { max-width: 720px; padding-top: 48px; display: flex; flex-direction: column; gap: 16px; }
.prose h1 { font-size: clamp(34px, 6vw, 52px); }
.prose h2 { margin-top: 24px; font-size: clamp(24px, 4vw, 30px); }
.prose p, .prose li { font-size: 18px; color: var(--muted); }
.prose ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.prose .placeholder { background: rgba(255, 210, 63, 0.35); padding: 0 4px; border-radius: 4px; color: var(--ink); }

/* Word counter and case converter. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.stat dt { font-size: 14px; font-weight: 700; color: var(--muted); }
.stat dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 28px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.status { min-height: 1.6em; font-size: 15px; color: var(--muted); }

/* Guides and reference pages. */
.prose h3 { margin-top: 12px; font-size: 20px; letter-spacing: 0; }
.prose ol { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; }
.prose a { color: var(--ink); text-underline-offset: 3px; }
.prose .chips { gap: 6px; }
.prose .chip { padding: 4px 12px; font-size: 17px; color: var(--ink); }
.notice { background: rgba(255, 210, 63, 0.25); border: 1px solid var(--yellow); border-radius: 14px; padding: 12px 16px; }
.notice p { font-size: 16px; color: var(--ink); }
.jump { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.jump a { font-family: var(--display); font-weight: 600; }
.gloss { margin: 0; display: grid; gap: 12px; }
.gloss dt { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--ink); }
.gloss dd { margin: 2px 0 0; font-size: 18px; color: var(--muted); }
.guide-cards .card h3 { font-size: 20px; }
.block.narrow ul.plain { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 18px; color: var(--muted); }
.block.narrow ol { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; font-size: 18px; color: var(--muted); }
.block.narrow h3 { font-size: 20px; margin-top: 8px; }
.block.narrow a { color: var(--ink); }

/* Clear all button. */
.more-row { position: relative; }
.more-row .clear-btn { position: absolute; left: 190px; top: 4px; }
.row.end { justify-content: flex-end; }
.btns .clear-btn { margin-left: auto; }
@media (max-width: 480px) {
  .more-row .clear-btn { padding: 0 14px; }
  .more summary { padding: 0 14px; }
}
.more-row { min-height: 52px; }
.more-row .clear-btn { top: 4px; }
@media (max-width: 480px) {
  .nav { gap: 4px 16px; }
  .site-header .nav a { font-size: 16px; }
}

/* Green word chips in results. */
.results .chip, .pill { background: var(--green); }

/* Filter-only searches (no letters typed): white letters on the green chips. */
.chip .hl { color: #fff; }

/* Text cursor only blinks inside fields you have selected. */
body { caret-color: transparent; }
input, textarea, [contenteditable="true"] { caret-color: auto; }

/* Tools page: cards use the same width and two-column layout as the Guides page. */
body[data-page="tools"] .block > .cards { max-width: 720px; }
body[data-page="tools"] .block > .cards .card { flex: 0 0 calc(50% - 10px); }
@media (max-width: 640px) { body[data-page="tools"] .block > .cards .card { flex: 1 1 100%; } }
body[data-page="tools"] .block > .cards .card h3 { font-size: 20px; }

/* About page cards: link colour. */
.prose .card a { color: var(--ink); text-underline-offset: 3px; }
.prose .guide-cards .card { flex: 0 0 calc(50% - 10px); }
@media (max-width: 640px) { .prose .guide-cards .card { flex: 1 1 100%; } }
.prose .card p { font-size: 16px; line-height: 1.5; }
.prose .card h3 { margin-top: 0; }
.prose .card ul, .prose .card ol { margin: 0; padding-left: 22px; font-size: 16px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.prose .card li { font-size: 16px; line-height: 1.5; }
.prose .card h3 { font-size: 20px; }
.prose .card a { overflow-wrap: anywhere; }
body[data-page="privacy"] .prose .guide-cards .card { flex: 1 1 100%; }
.field.big::placeholder { letter-spacing: 0; font-weight: 500; }
