:root {
  --bg: #ffffff;
  --ink: #17161d;
  --soft: #74727f;
  --accent: #5b5bf0;
  --wrong: #e2483d;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 14px;
}

.card { width: min(360px, 100%); }
.top { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 7px; }
.top__label { font-size: 14px; font-weight: 640; }
.top__left { display: flex; align-items: baseline; gap: 4px; font-size: 12.5px; color: var(--soft); transition: color 0.3s ease; }
.top__n { height: 16px; overflow: hidden; line-height: 16px; font-weight: 700; color: var(--ink); transition: color 0.3s ease; }
.top__n span { display: block; }
.card.is-full .top__left, .card.is-full .top__n { color: var(--wrong); }

/* ---- the field: the tags and the input share the same box ---- */
.field {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  min-height: 92px;
  padding: 9px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fafafc);
  box-shadow:
    inset 0 0 0 1.2px rgba(23, 22, 29, 0.14),
    0 1px 2px rgba(23, 22, 29, 0.05),
    0 12px 26px -16px rgba(40, 40, 120, 0.3);
  cursor: text;
  transition: box-shadow 0.25s ease;
}
.field:focus-within, .field.is-on {
  box-shadow:
    inset 0 0 0 1.6px var(--accent),
    0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent),
    0 12px 26px -16px rgba(40, 40, 120, 0.3);
}
.card.is-full .field { box-shadow: inset 0 0 0 1.6px var(--wrong), 0 0 0 4px color-mix(in srgb, var(--wrong) 14%, transparent); }
.tags { display: contents; list-style: none; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 4px 0 12px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 12%, #ffffff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent);
  color: color-mix(in srgb, var(--accent) 72%, #17161d);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.tag button { width: 24px; height: 24px; margin-left: 2px; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; transition: background-color 0.2s ease; }
.tag button svg { width: 12px; height: 12px; }
.tag button path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (hover: hover) { .tag button:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); } }
.tag button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Backspace on an empty field: the last tag is marked first, removed at the second press */
.tag.is-armed { background: var(--accent); color: #ffffff; box-shadow: 0 4px 10px -4px color-mix(in srgb, var(--accent) 70%, transparent); }
.field__input { flex: 1 1 96px; min-width: 96px; height: 32px; padding: 0 4px; border: 0; outline: 0; background: none; color: inherit; font: inherit; font-size: 15px; font-weight: 500; }
.field__input::placeholder { color: #a9a7b3; }

.hint { height: 18px; margin-top: 7px; padding: 0 4px; overflow: hidden; font-size: 12.5px; line-height: 18px; color: var(--soft); transition: color 0.3s ease; }
.hint span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.is-full .hint { color: var(--wrong); }

/* ---- the suggestions ---- */
.ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ideas button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 99px;
  background: rgba(23, 22, 29, 0.05);
  box-shadow: inset 0 0 0 1px rgba(23, 22, 29, 0.07);
  color: var(--soft);
  font: inherit;
  font-size: 13px;
  font-weight: 580;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, opacity 0.3s ease;
}
.ideas button.is-match, .ideas button.is-hot { background: color-mix(in srgb, var(--accent) 10%, #ffffff); box-shadow: inset 0 0 0 1.4px var(--accent); color: color-mix(in srgb, var(--accent) 72%, #17161d); }
@media (hover: hover) { .ideas button:hover { color: var(--ink); background: rgba(23, 22, 29, 0.09); } }
.ideas button.is-miss { opacity: 0.4; }
.ideas button.is-used { opacity: 0.3; pointer-events: none; text-decoration: line-through; }
.ideas button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #14151a;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(20, 21, 26, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (min-width: 900px) and (min-height: 680px) {
  .card { zoom: 1.35; }
}
