/* identity.css — the name popup, the times board, and the "not you?" link.
   Both pages load this. It leans only on /assets/tokens.css, so it sits
   correctly on the home card stack and on top of the solving chrome. */

/* ── The popup ────────────────────────────────────────────── */
.xwid-veil {
  position: fixed;
  inset: 0;
  z-index: 80;                    /* above the completion modal, which is 70 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
}
.xwid-veil[hidden] { display: none !important; }
body.xwid-locked { overflow: hidden; }

.xwid-card {
  width: min(360px, 100%);
  margin: 0;
  padding: 28px 24px 24px;
  border-radius: 14px;
  background: var(--xw-bg);
  color: var(--xw-ink);
  font-family: var(--xw-font-ui);
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  animation: xwid-pop 0.3s cubic-bezier(0.2, 1.3, 0.5, 1) both;
}
@keyframes xwid-pop {
  from { transform: translateY(14px) scale(0.94); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.xwid-h {
  margin: 0;
  font-family: var(--xw-font-mast);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.xwid-sub {
  margin: 8px 0 18px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--xw-muted);
}

/* 17px, because anything under 16 makes iOS zoom the page on focus. */
.xwid-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--xw-ink) 22%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--xw-ink) 4%, var(--xw-bg));
  color: var(--xw-ink);
  font-family: inherit;
  font-size: 17px;
  text-align: center;
}
.xwid-input:focus-visible { outline: 3px solid var(--xw-accent); outline-offset: 2px; }

.xwid-go {
  width: 100%;
  margin-top: 14px;
  padding: 13px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--xw-accent);
  color: #fff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}
.xwid-go:hover { filter: brightness(1.06); }
.xwid-go:disabled { opacity: 0.45; cursor: default; filter: none; }

/* ── "¿No eres Nora?" ─────────────────────────────────────── */
.xwid-who {
  margin: 0;
  padding: 18px 16px 8px;
  font-family: var(--xw-font-ui);
  font-size: 11px;
  color: var(--xw-muted);
  text-align: center;
}
.xw-foot .xwid-who { padding: 6px 0 0; }     /* the solve page brings its own */
.xwid-who button {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.xwid-who button:hover { color: var(--xw-ink); }

/* ── The board, inside the completion modal ───────────────── */
.xwid-board { margin: 0 0 22px; text-align: left; }
.xwid-board-h {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--xw-muted);
  text-align: center;
}
.xwid-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--xw-ink) 14%, transparent);
  border-radius: 10px;
}
.xwid-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  font-size: 14px;
}
.xwid-row + .xwid-row {
  border-top: 1px solid color-mix(in srgb, var(--xw-ink) 9%, transparent);
}
.xwid-row.is-me {
  background: color-mix(in srgb, var(--xw-accent) 14%, transparent);
  font-weight: 700;
}
.xwid-rank {
  flex: none;
  width: 1.5em;
  color: var(--xw-muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.xwid-row.is-me .xwid-rank { color: inherit; }
.xwid-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.xwid-secs {
  flex: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── The same board, opened from the top bar mid-solve ────── */
/* Rows come from the same builder as the modal's, so this is only a frame. */
.xwbd-veil {
  position: fixed;
  inset: 0;
  z-index: 78;                    /* over the completion modal (70), under the name popup (80) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
}
.xwbd-veil[hidden] { display: none !important; }

.xwbd-card {
  width: min(340px, 100%);
  padding: 22px 20px 18px;
  border-radius: 14px;
  background: var(--xw-bg);
  color: var(--xw-ink);
  font-family: var(--xw-font-ui);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  animation: xwid-pop 0.24s cubic-bezier(0.2, 1.3, 0.5, 1) both;
}

.xwbd-h {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--xw-muted);
  text-align: center;
}

.xwbd-body { min-height: 44px; }
/* Taller than the modal's copy: this panel has nothing else competing. */
.xwbd-body .xwid-list { max-height: min(52vh, 320px); }

.xwbd-note {
  margin: 0;
  padding: 13px 0;
  font-size: 14px;
  color: var(--xw-muted);
  text-align: center;
}

.xwbd-close {
  width: 100%;
  margin-top: 16px;
  padding: 11px 20px;
  border: 1px solid color-mix(in srgb, var(--xw-ink) 18%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--xw-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.xwbd-close:hover { background: color-mix(in srgb, var(--xw-ink) 6%, transparent); }
.xwbd-close:focus-visible { outline: 3px solid var(--xw-accent); outline-offset: 2px; }

/* ── Best time on the home page ───────────────────────────── */
.xwid-rowbest {
  display: block;
  margin-top: 0.15rem;
  color: var(--home-accent-text, var(--xw-accent));
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  .xwid-card, .xwbd-card { animation: none; }
}
