/* Shared components: cards, buttons, pills, tags, banners, share box. */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
  padding-inline: 0.45rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* The computer's level next to its name. */
.tag.bot { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }

/* A piece on a cream disc: the black pieces stay visible in the dark theme. */
.piece-icon {
  inline-size: 2.2rem;
  block-size: 2.2rem;
  padding: 0.1rem;
  border-radius: 50%;
  background: var(--sq-light);
}

/* ---- buttons ---- */
.button {
  font: inherit;
  font-weight: 600;
  padding-block: 0.6rem;
  padding-inline: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.button:hover { border-color: var(--accent); }
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.button.danger { color: var(--danger); border-color: var(--danger); }
.button.danger.armed { background: var(--danger); color: var(--surface); }
.button:disabled { opacity: 0.6; cursor: default; }
a.button { display: inline-block; text-decoration: none; text-align: center; }

/* Small rounded buttons in the header. */
.pill-btn {
  font: inherit;
  padding-block: 0.25rem;
  padding-inline: 0.85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;       /* it is a link for Log in / Sign up */
}
.pill-btn:hover:not(:disabled) { border-color: var(--accent); }
.pill-btn.solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
.pill-btn:disabled { opacity: 0.55; cursor: not-allowed; }

:is(.button, .pill-btn, .icon-btn, .pills input):focus-visible,
.pills input:focus-visible + label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---- option pills (radio groups) ---- */
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; padding: 0; }

.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* The radio input is visually hidden; the label next to it is the pill. */
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills label {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-inline-size: 4.6rem;
  padding-block: 0.5rem;
  padding-inline: 0.9rem;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
}
.pills label:hover { border-color: var(--accent); }
.pills input:checked + label {
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.pills .sub { font-size: 0.7rem; font-weight: 400; color: var(--muted); }

.errorlist { color: var(--danger); list-style: none; padding: 0; margin: 0.25rem 0 0; }

/* ---- banners (game page) ---- */
.banner {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.banner.warn { background: var(--warn-bg); color: var(--warn-text); }
.banner.error { background: var(--danger); color: var(--surface); }
/* The opponent has left: the text, then (once the wait is over) the claim buttons. */
.banner.claim { display: grid; gap: 0.5rem; }
.banner.claim[hidden] { display: none; }
.claim-actions:not([hidden]) { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---- share box (game page) ---- */
.share label { font-weight: 600; display: block; margin-block-end: 0.4rem; }
.share-row { display: flex; gap: 0.5rem; }
.share-row input {
  flex: 1;
  min-inline-size: 0;
  font: inherit;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

/* Shown to visitors who are not logged in (there are no guest players). */
.login-prompt {
  display: grid;
  gap: 0.75rem;
}
.login-prompt p { margin: 0; }
.prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.user-name {
  font-weight: 600;
  align-self: center;
}
