:root {
  --bg: #fdf6e3;
  --ink: #2b2117;
  --accent: #d43d2a;      /* NL red */
  --accent-dark: #a82c1d;
  --yolk: #ffb937;
  --card: #fffdf7;
  --line: #e8dcc4;
  --muted: #8a7a63;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

header { text-align: center; margin-bottom: 28px; }
.egg-logo { font-size: 56px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.12)); }
h1 {
  font-family: "Bungee", "Nunito", sans-serif;
  font-size: clamp(38px, 9vw, 56px);
  color: var(--accent);
  letter-spacing: 2px;
  text-shadow: 0 3px 0 rgba(0,0,0,.14);
}
.tagline { color: var(--muted); font-weight: 700; font-size: 18px; }

#form {
  display: flex;
  gap: 8px;
  margin: 22px 0 10px;
  flex-wrap: wrap;
}
.input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
#handle {
  width: 100%;
  padding: 14px 16px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  background: var(--card);
}
#handle:focus { outline: 3px solid var(--yolk); }

#typeahead {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 6px 0 rgba(0,0,0,.18);
  overflow: hidden;
  z-index: 10;
}
.ta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
}
.ta-row:hover, .ta-row.active { background: #fff0cd; }
.ta-row img {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--line);
  flex-shrink: 0;
}
.ta-name {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ta-handle {
  color: var(--muted);
  font-size: 13px;
  margin-left: auto;
  white-space: nowrap;
}
#go {
  padding: 14px 22px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .05s;
}
#go:hover { background: var(--accent-dark); }
#go:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
#go:disabled { opacity: .6; cursor: wait; }

#status {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  margin: 14px 0;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .45; } }

#intro {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px;
  margin-top: 22px;
}
#intro p + p { margin-top: 12px; }
#intro .fine { font-size: 14px; color: var(--muted); }
#intro a { color: var(--accent); }

/* ---- result ---- */
#result { margin-top: 26px; text-align: center; }

.who {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}
.who img {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--line);
}
.who > div { text-align: left; }
#who-name { font-weight: 900; font-size: 18px; }
#who-handle { color: var(--muted); font-size: 14px; }

.egg-score { display: flex; justify-content: center; margin: 8px 0 14px; }
.egg-shape {
  width: 190px; height: 240px;
  background: linear-gradient(180deg, #fffef9 0%, #fff3d6 70%, #ffe9b8 100%);
  border: 4px solid var(--ink);
  border-radius: 50% 50% 50% 50% / 60% 60% 42% 42%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 0 rgba(0,0,0,.15), inset -12px -14px 0 rgba(0,0,0,.04);
}
#score-num {
  font-family: "Bungee", sans-serif;
  font-size: 72px;
  color: var(--accent);
  line-height: 1;
}
.pct { font-weight: 900; color: var(--muted); letter-spacing: 1px; }

#tier {
  font-family: "Bungee", sans-serif;
  font-size: clamp(20px, 5vw, 28px);
  color: var(--ink);
  margin-bottom: 4px;
}
#stats { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

.share-btn {
  display: inline-block;
  padding: 12px 20px;
  background: #1183fe;         /* bluesky blue */
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
  margin-bottom: 30px;
}
.share-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

#result h2 {
  font-size: 20px;
  margin: 10px 0 14px;
  text-align: left;
}
#none { color: var(--muted); font-style: italic; }

.phrase {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  text-align: left;
}
.phrase-text { font-weight: 900; font-size: 18px; }
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: var(--yolk);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
  vertical-align: 2px;
}
.phrase-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}
.clip {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}
.clip:hover { text-decoration: underline; }

#more {
  padding: 10px 18px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--yolk);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}

footer {
  margin-top: 48px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
footer a { color: var(--accent); }
