:root {
  --mist: #eef0f7;
  --card: #ffffff;
  --ink: #35314e;
  --muted: #6f6a8a;
  --line: #e2dff0;
  --iris: #6d64c8;
  --iris-wash: #f0effa;
  --blush: #e8a2b8;
  --apricot: #fbf0dc;
  --mint: #dcebe4;
  --rose-err: #8a2e4a;
  --ok: #538d4e;
  --maybe: #c9b458;
  --no: #787c7e;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(53, 49, 78, .06), 0 10px 28px rgba(53, 49, 78, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--mist);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 620px; }

a { color: var(--iris); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--iris);
  outline-offset: 2px;
}

.topbar {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 24px;
  text-decoration: none;
  color: var(--ink);
  text-transform: lowercase;
}
.logo::after { content: "."; color: var(--blush); }
.topnav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 18px;
  font-weight: 600;
  font-size: 15px;
}
.topnav a:hover { color: var(--ink); }
.btn-make {
  background: var(--ink) !important;
  color: #fff !important;
  padding: 9px 16px !important;
  border-radius: 999px !important;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr .85fr;
  gap: 28px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin: 20px 0 8px;
  padding: 36px 32px;
  border-radius: 26px;
}
.hero h1 {
  font-family: Georgia, "Iowan Old Style", serif;
  font-weight: 500;
  margin: 0 0 10px;
  font-size: 40px;
  line-height: 1.12;
  letter-spacing: -.01em;
  max-width: 16em;
}
.hero h1 em { color: var(--iris); }
.hero p { color: var(--muted); margin: 0; font-size: 17px; }
.hero-card {
  background: var(--mint);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
}
.hero-tiles { display: flex; gap: 6px; justify-content: center; }
.hero-tiles span {
  width: 44px; height: 44px; line-height: 44px;
  font-weight: 700; font-size: 24px;
  border-radius: 8px; color: #fff;
  background: var(--no);
}
.hero-tiles span.g { background: var(--ok); }
.hero-tiles span.y { background: var(--maybe); }
.hero-cap { font-family: Georgia, serif; font-style: italic; font-size: 17px; margin-top: 10px; }
.hero-fine { font-size: 13px; color: var(--muted); margin-top: 4px; }

.btn-big {
  display: inline-block;
  background: var(--iris);
  color: #fff;
  font-weight: 650;
  font-size: 16px;
  padding: 13px 24px;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  margin-top: 16px;
}
.btn-big:hover { filter: brightness(1.06); }

.stats {
  display: flex;
  justify-content: flex-start;
  gap: 40px;
  margin: 20px 0 8px;
  padding: 14px 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.stat { text-align: left; }
.stat strong {
  display: block;
  font-family: Georgia, serif;
  font-weight: 500;
  font-size: 30px;
  color: var(--ink);
}
.stat span { font-size: 13.5px; color: var(--muted); }

.foot { margin: 36px 0; color: var(--muted); font-size: 13.5px; text-align: center; }

h1 {
  font-family: Georgia, serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -.01em;
}
h2 { font-family: Georgia, serif; font-weight: 500; font-size: 21px; margin: 26px 0 6px; }

label { display: block; margin: 14px 0; font-weight: 600; font-size: 14.5px; }
input, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  text-transform: none;
}
input.word { text-transform: uppercase; font-weight: 700; letter-spacing: .2em; }
input:focus, textarea:focus { border-color: var(--iris); outline: none; box-shadow: 0 0 0 3px var(--iris-wash); }

.wlist { display: grid; gap: 8px; margin: 12px 0; }
.wrow { display: flex; gap: 8px; align-items: center; }
.wrow input { margin-top: 0; }
.wrow button { flex-shrink: 0; }

.btn-ghost {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
  margin: 4px 4px 4px 0;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
}
.btn-ghost:hover { border-color: var(--iris); color: var(--iris); }

.err {
  background: #fdf0f3;
  border: 1px solid #e9a9be;
  color: var(--rose-err);
  padding: 12px 14px;
  margin: 12px 0;
  border-radius: 12px;
}
.done {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 20px 0;
  border-radius: 20px;
}
.done h2 { margin-top: 0; }
.mono { font-family: ui-monospace, monospace; word-break: break-all; background: var(--mist); padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; }

.board { display: grid; gap: 6px; margin: 18px auto; justify-content: center; }
.brow { display: flex; gap: 6px; }
.tile {
  width: 56px; height: 56px;
  border: 2px solid var(--line);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; text-transform: uppercase;
  background: #fff;
}
.tile.filled { border-color: #a9a3cf; }
.tile.correct { background: var(--ok); border-color: var(--ok); color: #fff; }
.tile.present { background: var(--maybe); border-color: var(--maybe); color: #fff; }
.tile.absent { background: var(--no); border-color: var(--no); color: #fff; }
.tile.pop { animation: pop .12s ease; }
@keyframes pop { 50% { transform: scale(1.08); } }

.kb { display: grid; gap: 6px; margin: 10px auto 0; max-width: 480px; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.key {
  flex: 1 1 0; max-width: 44px; height: 52px;
  border: 0; border-radius: 6px;
  background: #d3d6da; color: var(--ink);
  font-weight: 700; font-size: 13px; font-family: inherit;
  cursor: pointer;
}
.key.wide { max-width: 68px; font-size: 11px; }
.key.correct { background: var(--ok); color: #fff; }
.key.present { background: var(--maybe); color: #fff; }
.key.absent { background: var(--no); color: #fff; }

.msg { text-align: center; min-height: 28px; font-weight: 650; margin: 8px 0; }
.msg.win { color: var(--ok); }
.gstats { display: flex; gap: 24px; justify-content: center; margin: 8px 0; color: var(--muted); font-size: 14px; }
.gstats strong { color: var(--ink); }
.kicker { font-size: 13px; font-weight: 650; color: var(--muted); margin: 0 0 2px; }
.muted { color: var(--muted); }
.share-row { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.result {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  margin-top: 18px;
}

main.wrap { padding-bottom: 12px; }

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; padding: 26px 22px; }
  .hero h1 { font-size: 31px; }
  .stats { gap: 12px; }
  .stat strong { font-size: 24px; }
  .topnav a:first-child { display: none; }
  .tile { width: 46px; height: 46px; font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
