/* Part of the design system, loaded after app.css (see templates/base.html). Tokens live in app.css. */

/* ===========================================================================
   Sharing: the share window (event and tournament pages) and Settings -> Sharing
   =========================================================================== */
.share-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--app-text-muted);
  margin: 1rem 0 0.25rem;
}
.share-options { border-top: 1px solid var(--app-border); }
.share-options .list-row { border-bottom: 1px solid var(--app-border); padding: 0.6rem 0; }
.share-option-text { color: var(--app-text-muted); margin-top: 0.15rem; }
.share-done { color: var(--app-success); margin-top: 0.25rem; }
.share-done .bi { margin-right: 0.25rem; }
.share-outcome-link { margin: -0.5rem 0 1rem; }
.share-for { color: var(--app-text-muted); margin-bottom: 0.75rem; }
#share-text { font-size: 16px; line-height: 1.45; }

.share-placeholders { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin-top: 0.5rem; }
.share-placeholders .form-text { margin: 0 0.25rem 0 0; }
.share-placeholder {
  border: 1px solid var(--app-border);
  background: var(--app-surface-2);
  border-radius: var(--app-radius-sm);
  padding: 0.05rem 0.4rem;
  line-height: 1.4;
  cursor: pointer;
}
.share-placeholder:hover, .share-placeholder:focus-visible { border-color: var(--app-primary); }
.share-placeholder code { color: var(--app-primary); font-size: 0.8rem; }
.share-preview {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--app-border-strong);
  border-radius: var(--app-radius);
  background: var(--app-surface-2);
}
.share-preview-label { font-size: 0.75rem; color: var(--app-text-soft); margin-bottom: 0.35rem; }
.share-preview-text { white-space: normal; overflow-wrap: anywhere; }
.share-card { display: flex; align-items: center; gap: 1rem; margin-top: 0.75rem; }
.share-card img { width: 160px; height: 160px; border-radius: var(--app-radius-sm); border: 1px solid var(--app-border); flex-shrink: 0; }
.share-settings-link { color: var(--app-text-muted); }

/* share composer: Shuffle under the text, the generated card with its layout tools */
.share-text-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: -0.5rem 0 0.75rem; }
.share-card-box { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 0.75rem; }
.share-card-box .share-picture--card { width: 120px; flex-shrink: 0; }
.share-card-box .share-card-img { width: 160px; height: 160px; border-radius: var(--app-radius-sm); border: 1px solid var(--app-border); flex-shrink: 0; }
.share-card-tools { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; min-width: 0; }
.share-card-layout { font-size: 0.875rem; color: var(--app-text-muted); }
.share-planned { margin-top: 0.75rem; }

/* share window: network status, Facebook post / event switch */
.share-status { display: flex; align-items: center; gap: 0.4rem; color: var(--app-warning-text); font-size: 0.875rem; margin-bottom: 0.5rem; }
.share-status--live { color: var(--app-success-text); }
.share-mode { display: flex; margin-bottom: 1rem; }
.share-mode .btn { flex: 1 1 0; }
.share-mode .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.share-mode .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }

/* Facebook composer: picture picker (gallery, generated card, uploads for this post) */
.share-pictures { border: 0; padding: 0; margin: 0.25rem 0 0; min-width: 0; }
.share-pictures-title { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.15rem; float: none; }
.share-pictures-help { font-size: 0.8125rem; color: var(--app-text-muted); margin-bottom: 0.5rem; }
.share-pictures-count { font-size: 0.8125rem; color: var(--app-text-muted); margin: 0.5rem 0 0; }
.share-pictures-count.is-over { color: var(--app-danger-text); font-weight: 600; }
.share-picture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.5rem; }
.share-picture-grid--uploads:empty { display: none; }
.share-picture-grid--uploads { margin-top: 0.5rem; }
.share-picture {
  position: relative;
  aspect-ratio: 1;
  margin: 0;
  border-radius: var(--app-radius-sm);
  border: 2px solid var(--app-border);
  overflow: hidden;
  cursor: pointer;
  background: var(--app-surface-2);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.share-picture img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.55; transition: opacity 0.15s; }
.share-picture input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.share-picture:has(input:checked) { border-color: var(--app-primary); box-shadow: 0 0 0 2px var(--app-primary-soft); }
.share-picture:has(input:checked) img, .share-picture--upload img { opacity: 1; }
.share-picture:has(input:focus-visible) { outline: 3px solid var(--app-primary); outline-offset: 2px; }
.share-picture-check {
  position: absolute; top: 0.3rem; right: 0.3rem;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--app-surface); color: transparent; border: 1px solid var(--app-border-strong);
  font-size: 0.85rem;
}
.share-picture:has(input:checked) .share-picture-check { background: var(--app-primary); border-color: var(--app-primary); color: var(--app-on-color); }
.share-picture-tag {
  position: absolute; left: 0.3rem; bottom: 0.3rem;
  font-size: 0.6875rem; font-weight: 600; padding: 0.05rem 0.4rem;
  border-radius: var(--app-radius-sm); background: rgba(0, 0, 0, 0.6); color: var(--app-on-color);
}
.share-picture--add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
  border-style: dashed; color: var(--app-text-muted); font-size: 0.75rem; text-align: center; padding: 0.25rem;
}
.share-picture--add .bi { font-size: 1.4rem; color: var(--app-primary); }
.share-picture--add:hover, .share-picture--add:has(input:focus-visible) { border-color: var(--app-primary); color: var(--app-text); }
.share-picture--add input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.share-picture--upload { border-color: var(--app-primary); cursor: default; }
.share-picture-remove {
  position: absolute; top: 0.3rem; right: 0.3rem;
  width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 0;
  display: grid; place-items: center; font-size: 0.75rem;
  background: var(--app-surface); color: var(--app-text);
}
.share-picture-remove:hover, .share-picture-remove:focus-visible { background: var(--app-danger); color: var(--app-on-color); }

/* Facebook event: numbered steps, fields to copy, the cover */
.share-steps { list-style: none; padding: 0; margin: 0; counter-reset: share-step; }
.share-step { position: relative; padding: 0 0 1.25rem 2.75rem; counter-increment: share-step; }
.share-step::before {
  content: counter(share-step);
  position: absolute; left: 0; top: 0;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--app-primary-soft); color: var(--app-primary-soft-text); font-weight: 700; font-size: 0.9rem;
}
.share-step:not(:last-child)::after {
  content: ""; position: absolute; left: 0.93rem; top: 2.2rem; bottom: 0.3rem;
  width: 2px; background: var(--app-border);
}
.share-step-title { font-size: 1rem; font-weight: 600; margin: 0.3rem 0 0.35rem; }
.share-step-text { color: var(--app-text-muted); font-size: 0.875rem; margin-bottom: 0.6rem; }
.share-step-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-top: 0.4rem; }
.share-step-row .form-text { margin: 0; }
.share-facts { margin: 0 0 0.9rem; border: 1px solid var(--app-border); border-radius: var(--app-radius); overflow: hidden; }
.share-fact { display: grid; grid-template-columns: 7rem 1fr; align-items: center; gap: 0.5rem; padding: 0.45rem 0.5rem 0.45rem 0.75rem; }
.share-fact + .share-fact { border-top: 1px solid var(--app-border); }
.share-fact dt { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--app-text-soft); }
.share-fact dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.share-fact dd span { overflow-wrap: anywhere; }
.share-cover { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; }
.share-cover img { width: 100%; max-width: 384px; height: auto; aspect-ratio: 1920 / 1005; border-radius: var(--app-radius-sm); border: 1px solid var(--app-border); }
.share-cover > div { flex: 1 1 12rem; }
@media (max-width: 575.98px) {
  .share-fact { grid-template-columns: 1fr; gap: 0.1rem; }
  .share-step { padding-left: 2.4rem; }
  .share-step-row { flex-direction: column; }
}
