/* Pre-release polish: small UX layer, no redesign. */
:root {
  --fmr-polish-blue: #050605;
  --fmr-polish-ink: #111827;
  --fmr-polish-muted: #64748b;
  --fmr-polish-border: rgba(15, 23, 42, .12);
  --fmr-polish-shadow: 0 18px 48px rgba(15, 23, 42, .13);
  --fmr-motion-ease: cubic-bezier(.2, .72, .18, 1);
  --fmr-motion-fast: 160ms;
  --fmr-motion-medium: 520ms;
  --fmr-motion-slow: 760ms;
}

html.fmr-polish-ready {
  scroll-behavior: smooth;
}

.fmr-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--fmr-motion-medium) var(--fmr-motion-ease), transform var(--fmr-motion-medium) var(--fmr-motion-ease);
}

.fmr-motion-ready main,
.fmr-motion-ready .fmr-clean-main,
.fmr-motion-ready .main-content {
  animation: fmr-page-enter var(--fmr-motion-slow) var(--fmr-motion-ease) both;
}

.fmr-motion-reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  clip-path: inset(0 0 9% 0);
  transition:
    opacity var(--fmr-motion-medium) var(--fmr-motion-ease),
    transform var(--fmr-motion-medium) var(--fmr-motion-ease),
    clip-path var(--fmr-motion-slow) var(--fmr-motion-ease);
  will-change: opacity, transform, clip-path;
}

.fmr-motion-delay-1 { transition-delay: 36ms; }
.fmr-motion-delay-2 { transition-delay: 72ms; }
.fmr-motion-delay-3 { transition-delay: 108ms; }
.fmr-motion-delay-4 { transition-delay: 144ms; }
.fmr-motion-delay-5 { transition-delay: 180ms; }
.fmr-motion-delay-6 { transition-delay: 216ms; }
.fmr-motion-delay-7 { transition-delay: 252ms; }
.fmr-motion-delay-8 { transition-delay: 288ms; }
.fmr-motion-delay-9 { transition-delay: 324ms; }

.fmr-reveal.is-visible,
.fmr-motion-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  clip-path: inset(0 0 0 0);
  will-change: auto;
}

:is(.card, .news-card, .event-card, .document-card, .album-card, .photo-card, .profile-card, .admin-card, .ioc-latest-news-card, .mn-news-item).fmr-polish-card {
  transition: transform var(--fmr-motion-fast) ease, box-shadow var(--fmr-motion-fast) ease, border-color var(--fmr-motion-fast) ease, background-color var(--fmr-motion-fast) ease;
  will-change: transform;
}

:is(.card, .news-card, .event-card, .document-card, .album-card, .photo-card, .profile-card, .admin-card, .ioc-latest-news-card, .mn-news-item).fmr-polish-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--fmr-polish-shadow);
}

.fmr-motion-ready :is(a, button, .btn, .fmr-btn, .filter-btn, .tab-btn, .mn-filter, .contacts-topic-btn, .document-download, .news-read-more) {
  transition:
    transform var(--fmr-motion-fast) ease,
    border-color var(--fmr-motion-fast) ease,
    background-color var(--fmr-motion-fast) ease,
    color var(--fmr-motion-fast) ease,
    box-shadow var(--fmr-motion-fast) ease;
}

.fmr-motion-ready :is(button, .btn, .fmr-btn, .filter-btn, .tab-btn, .mn-filter, .contacts-topic-btn, .document-download, .news-read-more):where(:not(:disabled)):active {
  transform: translateY(1px) scale(.992);
}

.fmr-motion-ready :is(.modal, .fmr-auth-modal, .mn-details-modal, .admin-modal) .modal-content {
  animation: fmr-modal-enter 240ms var(--fmr-motion-ease) both;
}

button.fmr-loading,
.btn.fmr-loading,
[type="submit"].fmr-loading {
  position: relative;
  pointer-events: none;
  opacity: .78;
}

button.fmr-loading::after,
.btn.fmr-loading::after,
[type="submit"].fmr-loading::after {
  content: "";
  display: inline-block;
  width: .95em;
  height: .95em;
  margin-left: .55em;
  vertical-align: -.14em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: fmr-spin .72s linear infinite;
}

@keyframes fmr-spin { to { transform: rotate(360deg); } }

.fmr-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100000;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}

.fmr-toast {
  pointer-events: auto;
  border: 1px solid var(--fmr-polish-border);
  border-left: 4px solid var(--fmr-polish-blue);
  background: rgba(255, 255, 255, .96);
  color: var(--fmr-polish-ink);
  box-shadow: 0 16px 42px rgba(15, 23, 42, .16);
  border-radius: 16px;
  padding: 12px 14px;
  font: 500 14px/1.42 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transform: translateY(10px);
  opacity: 0;
  animation: fmr-toast-in .22s ease forwards;
  backdrop-filter: blur(10px);
}

.fmr-toast--success { border-left-color: #16a34a; }
.fmr-toast--warning { border-left-color: #f59e0b; }
.fmr-toast--error { border-left-color: #b42335; }

@keyframes fmr-toast-in { to { transform: translateY(0); opacity: 1; } }

@keyframes fmr-page-enter {
  from {
    opacity: .001;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fmr-modal-enter {
  from {
    opacity: .001;
    transform: translate3d(0, 8px, 0) scale(.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.fmr-empty-state {
  border: 1px dashed rgba(15, 23, 42, .2);
  background: linear-gradient(135deg, rgba(0, 102, 204, .055), rgba(255, 255, 255, .92));
  color: var(--fmr-polish-muted);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  margin: 18px 0;
}

.fmr-empty-state strong {
  display: block;
  color: var(--fmr-polish-ink);
  margin-bottom: 6px;
  font-size: 18px;
}

.fmr-mnemo-spark {
  position: fixed;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0,102,204,.9), rgba(0,102,204,0));
  pointer-events: none;
  z-index: 99999;
  animation: fmr-spark .7s ease-out forwards;
}

@keyframes fmr-spark {
  from { transform: translate(-50%, -50%) scale(.7); opacity: .9; }
  to { transform: translate(-50%, -50%) scale(5); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html.fmr-polish-ready { scroll-behavior: auto; }
  .fmr-reveal,
  .fmr-reveal.is-visible,
  .fmr-motion-reveal,
  .fmr-motion-reveal.is-visible,
  .fmr-motion-ready main,
  .fmr-motion-ready .fmr-clean-main,
  .fmr-motion-ready .main-content,
  .fmr-motion-ready :is(.modal, .fmr-auth-modal, .mn-details-modal, .admin-modal) .modal-content,
  :is(.card, .news-card, .event-card, .document-card, .album-card, .photo-card, .profile-card, .admin-card, .ioc-latest-news-card, .mn-news-item).fmr-polish-card,
  :is(.card, .news-card, .event-card, .document-card, .album-card, .photo-card, .profile-card, .admin-card, .ioc-latest-news-card, .mn-news-item).fmr-polish-card:hover {
    transition: none !important;
    animation: none !important;
    clip-path: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  button.fmr-loading::after,
  .btn.fmr-loading::after,
  [type="submit"].fmr-loading::after,
  .fmr-mnemo-spark {
    animation: none !important;
  }
}


/* Topic 94 auth modal visual polish 20260724 */
html body .fmr-auth-modal {
  display: none;
  position: fixed !important;
  inset: 0 !important;
  z-index: 13000 !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  background: rgba(0, 0, 0, .62) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 0 !important;
}

html body .fmr-auth-modal[style*="block"],
html body .fmr-auth-modal.is-open,
html body .fmr-auth-modal.active {
  display: flex !important;
}

html body.fmr-clean-page.fmr-auth-modal-open .fmr-clean-main {
  visibility: hidden !important;
}

html body .fmr-auth-modal .modal-content {
  width: min(468px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 40px) !important;
  overflow: auto !important;
  padding: 30px 30px 28px !important;
  background: #ffffff !important;
  border: 1px solid var(--topic94-page-line-strong, #bfc8d2) !important;
  border-radius: 0 !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24) !important;
  color: #142033 !important;
}

html body .fmr-auth-modal .close-modal {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  width: 44px !important;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid var(--topic94-page-line-strong, #bfc8d2) !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-size: 28px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

html body .fmr-auth-modal .close-modal:hover {
  background: #101827 !important;
  color: #ffffff !important;
  border-color: #101827 !important;
}

html body .fmr-auth-modal .close-modal::before,
html body .fmr-auth-modal .close-modal::after {
  content: none !important;
  display: none !important;
}

html body .fmr-auth-modal h2 {
  margin: 0 56px 22px 0 !important;
  color: #152238 !important;
  font-family: var(--topic94-serif, Georgia, 'Times New Roman', serif) !important;
  font-size: 30px !important;
  line-height: 1.1 !important;
  font-weight: 700 !important;
  letter-spacing: -.02em !important;
}

html body .fmr-auth-modal form {
  display: grid !important;
  gap: 12px !important;
  margin: 0 !important;
}

html body .fmr-auth-modal .form-group {
  margin: 0 !important;
}

html body .fmr-auth-modal .form-group input:not([type="checkbox"]):not([type="radio"]),
html body .fmr-auth-modal input:not([type="checkbox"]):not([type="radio"]) {
  width: 100% !important;
  min-height: 52px !important;
  padding: 0 15px !important;
  border-radius: 0 !important;
  border: 1px solid var(--topic94-page-line-strong, #bfc8d2) !important;
  background: #ffffff !important;
  color: #121a2a !important;
  font-size: 16px !important;
  line-height: 1.3 !important;
  box-shadow: none !important;
  outline: none !important;
}

html body .fmr-auth-modal input::placeholder {
  color: #6f7a8c !important;
}

html body .fmr-auth-modal input:focus {
  border-color: #111827 !important;
  box-shadow: inset 0 0 0 1px #111827 !important;
}

html body .fmr-auth-modal .auth-helper {
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  color: #657286 !important;
}

html body .fmr-auth-modal .auth-helper a,
html body .fmr-auth-modal .auth-switch a,
html body .fmr-auth-modal .auth-legal-note a {
  color: #24324a !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

html body .fmr-auth-modal .auth-helper a:hover,
html body .fmr-auth-modal .auth-switch a:hover,
html body .fmr-auth-modal .auth-legal-note a:hover {
  color: #000000 !important;
}

html body .fmr-auth-modal .btn,
html body .fmr-auth-modal button.btn {
  min-height: 48px !important;
  border-radius: 0 !important;
  padding: 0 18px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  border: 1px solid transparent !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

html body .fmr-auth-modal .btn-primary {
  background: #111827 !important;
  color: #ffffff !important;
  border-color: #111827 !important;
}

html body .fmr-auth-modal .btn-primary:hover {
  background: #020617 !important;
}

html body .fmr-auth-modal .btn-secondary,
html body .fmr-auth-modal .yandex-login-btn {
  background: #ffffff !important;
  color: #172033 !important;
  border-color: var(--topic94-page-line-strong, #bfc8d2) !important;
}

html body .fmr-auth-modal .btn-secondary:hover,
html body .fmr-auth-modal .yandex-login-btn:hover {
  background: #f4f6f8 !important;
  border-color: #111827 !important;
}

html body .fmr-auth-modal .auth-legal-note {
  margin: 14px 0 0 !important;
  padding: 10px 12px !important;
  border: 1px solid rgba(191, 200, 210, .72) !important;
  background: #f7f9fb !important;
  color: #697588 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}

html body .fmr-auth-modal .auth-switch {
  margin: 12px 0 0 !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(191, 200, 210, .72) !important;
  color: #5f6c80 !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
}

html body .fmr-auth-modal .error-message {
  margin-top: 5px !important;
  padding: 0 !important;
  border: 0 !important;
  color: #b42318 !important;
  background: transparent !important;
  font-size: 13px !important;
}

@media (max-width: 560px) {
  html body .fmr-auth-modal {
    padding: 12px !important;
    align-items: flex-start !important;
  }

  html body .fmr-auth-modal .modal-content {
    width: 100% !important;
    margin-top: 18px !important;
    padding: 26px 18px 22px !important;
    border-radius: 0 !important;
  }

  html body .fmr-auth-modal h2 {
    font-size: 28px !important;
  }
}


/* Topic 94 auth modal: remove old blue/translucent backing artifacts 20260724 */
html body .modal.fmr-auth-modal,
html body .fmr-auth-modal.modal {
  background: rgba(0, 0, 0, .62) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html body .fmr-auth-modal .modal-content::before,
html body .fmr-auth-modal .modal-content::after,
html body .fmr-auth-modal form::before,
html body .fmr-auth-modal form::after,
html body .fmr-auth-modal .form-group::before,
html body .fmr-auth-modal .form-group::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html body .fmr-auth-modal form,
html body .fmr-auth-modal .form-group,
html body .fmr-auth-modal .form-row {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html body .fmr-auth-modal .error-message:empty {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

/* Topic 94 tournament details: late-layer guard for registered cancel contrast. */
html body.tournament-details-page .td-strict-registered .btn-outline[data-tournament-action="cancel-registration"]:hover,
html body.tournament-details-page .td-strict-registered .btn-outline[data-tournament-action="cancel-registration"]:focus-visible {
  background: #050605 !important;
  border-color: #050605 !important;
  color: #ffffff !important;
}

html body.tournament-details-page .td-strict-registered .btn-outline[data-tournament-action="cancel-registration"]:hover i,
html body.tournament-details-page .td-strict-registered .btn-outline[data-tournament-action="cancel-registration"]:focus-visible i {
  color: currentColor !important;
}
