/* Dance Live Sync 3.5.8 - public display + Online Results UX layer.
   Kept separate from legacy styles.css so new responsive rules have one clear
   source of truth and do not add another patch block to the historical file. */

/* ---------- Shared interaction / rendering efficiency ---------- */
@supports (content-visibility: auto) {
  .category-card,
  .event-card,
  body.protected-online-body .protected-category-card,
  body.protected-online-body .protected-event-card {
    content-visibility: auto;
    contain-intrinsic-size: 86px;
  }
}
.category-card-clickable,
.participant-event-search-launch,
body.protected-online-body .protected-category-card { touch-action: manipulation; }

/* ---------- General display: event page ---------- */
.event-heading-panel-v357 { margin-bottom: 8px; }
.event-live-now {
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid rgba(22, 101, 52, .22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(240, 253, 244, .96), rgba(255,255,255,.96));
}
.event-live-now-heading,
.event-section-heading-row,
.category-card-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.event-live-now-heading { margin-bottom: 8px; }
.event-live-now-heading h2 { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 1.1rem; }
.event-live-now-heading > span {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-weight: 850;
}
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 4px rgba(22,163,74,.12); }
.event-live-now-list { margin: 0 !important; }

.event-participant-search-quick { margin: 8px 0 14px; }
.participant-event-search-launch {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 1px solid rgba(91, 40, 93, .2);
  border-radius: 13px;
  background: #fff;
  color: #172033;
  text-align: left;
  box-shadow: 0 4px 14px rgba(15,23,42,.045);
}
.participant-event-search-launch:hover,
.participant-event-search-launch:focus-visible { background: #fbf7fc; outline: 2px solid rgba(91,40,93,.25); outline-offset: 2px; }
.participant-event-search-launch .participant-search-icon { font-size: 25px; color: #5b285d; }
.participant-event-search-launch strong,
.participant-event-search-launch small { display: block; }
.participant-event-search-launch strong { font-size: .94rem; }
.participant-event-search-launch small { margin-top: 2px; color: #64748b; font-size: .74rem; font-weight: 650; }
.participant-search-arrow { font-size: 25px; color: #d0831f; }

.event-categories-primary { margin-top: 0; }
.event-section-heading-row { align-items: center; }
.event-section-heading-row h2 { margin: 0; }
.event-section-heading-row .public-filter-toggle { margin-left: auto; }

.event-statistics-section { padding-top: 4px !important; }
.event-statistics-details { border: 0; }
.event-statistics-details > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 1rem;
  font-weight: 850;
  text-transform: uppercase;
}
.event-statistics-details > summary::-webkit-details-marker { display: none; }
.event-statistics-details > summary::after { content: '⌄'; font-size: 20px; color: #d0831f; transition: transform .15s ease; }
.event-statistics-details[open] > summary::after { transform: rotate(180deg); }
.event-statistics-details .event-stats-grid { margin-top: 8px; }
.event-statistics-summary-count { display: none; }

/* Category cards: state first, metadata second. */
.category-card-title-line h3 { min-width: 0; margin: 0 !important; }
.category-card-state-line {
  margin-top: 5px;
  color: #475569;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.2;
}
.category-live-badge { flex: 0 0 auto; }
.category-card.category-card-compact { position: relative; overflow: hidden; }
.category-card.category-state-active { border-left-color: #2563eb !important; }
.category-card.category-state-not_started { border-left-color: #7c3aed !important; }
.category-card.category-state-not_closed { border-left-color: #d97706 !important; }
.category-card.category-state-closed { border-left-color: #94a3b8 !important; }
.category-card.category-state-cancelled { border-left-color: #dc2626 !important; }
.category-card.is-live-now { border-left-color: #16a34a !important; background: linear-gradient(90deg, rgba(240,253,244,.72), #fff 22%); }

/* Unified participant search */
.participant-unified-search-form .participant-search-line { grid-template-columns: 1fr !important; }
.participant-unified-search-form input { width: 100%; min-width: 0; box-sizing: border-box; }
.participant-entry-actions-v357 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) !important; }
.participant-entry-search-primary { border-color: rgba(91,40,93,.32) !important; background: #fbf7fc !important; }

/* Participant situation is a status card first. */
.participant-category-card .participant-category-status {
  margin-top: 8px;
  padding: 8px 9px;
  border-radius: 9px;
  background: #f8fafc;
}
.participant-category-card.is-live .participant-category-status { background: #f0fdf4; }
.participant-category-card .participant-category-status strong { font-size: .94rem; line-height: 1.2; }
.participant-category-card .participant-category-status span { margin-top: 2px; }
.participant-series-block { margin-top: 8px; }

/* ---------- General display: category navigation ---------- */
body.category-view-active .embedded-category-heading { padding-bottom: 0 !important; }
body.category-view-active .embedded-category-heading > h1 { margin-bottom: 7px !important; }
body.category-view-active .embedded-category-tabs.public-category-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  gap: 6px !important;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: 3px 1px 6px !important;
}
body.category-view-active .embedded-category-tabs.public-category-tabs .category-screen-tab {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: max-content !important;
  scroll-snap-align: start;
  white-space: nowrap;
}

/* Result/scoring table headers stay in context while scrolling vertically. */
.client-table-wrap .unified-results-table thead th,
.points-results-viewport .points-results-table thead th {
  position: sticky;
  top: 0;
  z-index: 16;
  background: #fffaf3;
}
.result-detail-cell { min-height: 34px; min-width: 34px; }

/* ---------- Online Results ---------- */
body.protected-online-body .protected-event-summary-v357 { padding-bottom: 8px; margin-bottom: 6px; }
body.protected-online-body .protected-event-summary-main {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: start;
  gap: 10px;
}
body.protected-online-body .protected-back-events-compact { min-height: 40px; padding: 7px 10px; }
body.protected-online-body .protected-event-title-copy { min-width: 0; }
body.protected-online-body .protected-event-title-copy h2 { margin: 2px 0 3px !important; text-transform: none; }
body.protected-online-body .protected-event-title-copy p { margin: 0; line-height: 1.25; }
body.protected-online-body .protected-live-categories-primary { padding-top: 6px; }
body.protected-online-body .protected-live-heading-row { margin-bottom: 6px; }
body.protected-online-body .protected-live-heading-row h2 { margin: 0 !important; display:flex; align-items:center; gap:7px; }
body.protected-online-body .protected-live-count {
  display: inline-flex; min-width: 26px; height: 26px; align-items:center; justify-content:center;
  border-radius:999px; background:#dcfce7; color:#166534; font-size:.78rem;
}
body.protected-online-body .protected-category-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 68px;
  padding: 9px 10px !important;
  border-left: 4px solid #16a34a !important;
}
body.protected-online-body .protected-category-card .category-card-main { min-width: 0; }
body.protected-online-body .protected-category-card .category-card-title-line h3 { font-size: .94rem; }
body.protected-online-body .protected-category-card .category-card-status-line { justify-content: flex-start; gap: 8px; margin-top: 4px; }
body.protected-online-body .protected-category-card .category-card-status-line strong { color: #166534; }
body.protected-online-body .protected-category-card .category-card-dance-line { margin-top: 2px; color:#64748b; }
body.protected-online-body .protected-card-open-hint { font-size: 28px; color: #d0831f; }
body.protected-online-body .protected-category-filter-panel { margin: 4px 0 7px !important; }

body.protected-online-body .protected-results-nav {
  position: sticky;
  top: 0;
  z-index: 42;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 6px !important;
  padding: 3px 0 5px;
  background: rgba(244,246,250,.96);
  backdrop-filter: blur(8px);
}
body.protected-online-body .protected-results-nav .category-screen-tab { width: 100%; }
body.protected-online-body .protected-results-toolbar { margin-top: 2px !important; }
.event-chat-button{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));z-index:50;min-height:48px;border-radius:24px;padding:10px 16px;box-shadow:0 8px 24px #0003}.event-chat-button b{display:inline-grid;place-items:center;min-width:20px;height:20px;border-radius:50%;background:#b91c1c;color:#fff}.event-chat-backdrop{position:fixed;inset:0;z-index:55;background:#0f172a66;backdrop-filter:blur(2px)}.event-chat-panel{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(72px,calc(env(safe-area-inset-bottom) + 64px));z-index:60;width:min(410px,calc(100vw - 24px));height:min(620px,calc(100dvh - 100px));background:#fff;border:1px solid #d7dee8;border-radius:16px;box-shadow:0 18px 50px #0004;display:grid;grid-template-rows:auto auto 1fr auto;overflow:hidden}.event-chat-head{display:flex;justify-content:space-between;align-items:center;padding:12px;background:#f5f7fb;border-bottom:1px solid #e2e8f0}.event-chat-head small{display:block;color:#64748b;margin-top:3px}.event-chat-head button{width:40px;height:40px;padding:0;font-size:22px}.event-chat-quick{display:flex;gap:6px;overflow-x:auto;padding:8px;border-bottom:1px solid #e2e8f0;scrollbar-width:thin}.event-chat-quick button{flex:0 0 auto;min-height:38px;font-size:.74rem;padding:7px 10px}.event-chat-messages{overflow:auto;padding:10px;background:#e9ecf1;overscroll-behavior:contain}.wa-empty{padding:20px;text-align:center;color:#64748b}.wa-day-separator{display:flex;justify-content:center;margin:10px 0}.wa-day-separator span{background:#fff;color:#64748b;font-size:11px;font-weight:700;padding:4px 12px;border-radius:999px;box-shadow:0 1px 2px rgba(0,0,0,.08)}.wa-bubble-row{display:flex;margin:4px 0}.wa-bubble-row.mine{justify-content:flex-end}.wa-bubble{max-width:86%;padding:8px 10px;border-radius:10px;background:#fff;border:1px solid #e2e8f0;box-shadow:0 1px 1px rgba(0,0,0,.06);overflow-wrap:anywhere}.wa-bubble-row.mine .wa-bubble{background:#d9fdd3;border-color:#c8f0bf}.wa-bubble p{margin:0;white-space:pre-wrap;font-size:14px;line-height:1.35;color:#152033}.wa-bubble-meta{display:flex;justify-content:flex-end;align-items:center;gap:4px;margin-top:2px}.wa-bubble-time{font-size:10.5px;color:#64748b}.wa-ticks{font-size:12px;color:#64748b;line-height:1}.wa-ticks.delivered,.wa-ticks.read{color:#8696a0}.wa-ticks.read{color:#53bdeb}.event-chat-context{font-size:.7rem;color:#475569}.event-chat-form{display:grid;grid-template-columns:1fr auto;gap:7px;padding:9px;padding-bottom:max(9px,env(safe-area-inset-bottom));border-top:1px solid #e2e8f0;background:#fff}.event-chat-form textarea{resize:none;min-width:0;font-size:16px}.event-chat-form button{align-self:stretch;min-width:82px}@media(min-width:601px) and (max-width:1100px){.event-chat-panel{width:min(460px,calc(100vw - 32px));height:min(680px,calc(100dvh - 80px))}}@media(max-width:600px){.event-chat-button{right:max(8px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom))}.event-chat-panel{inset:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));width:auto;height:auto;border-radius:13px}.event-chat-quick{flex-wrap:nowrap}.wa-bubble{max-width:92%}}
body.protected-online-body .protected-results-table-wrap {
  position: relative;
  overscroll-behavior: contain;
}
body.protected-online-body .protected-single-round-results-table thead th {
  position: sticky;
  top: 0;
  z-index: 18;
  background: #fffaf3;
  box-shadow: 0 1px 0 #d0831f;
}
body.protected-online-body .protected-single-round-results-table .unified-results-stage th {
  position: sticky;
  top: 34px;
  z-index: 17;
  background: #fff7e8;
}
body.protected-online-body .protected-single-round-results-table .result-detail-cell {
  min-width: 36px;
  min-height: 36px;
  padding: 5px 6px;
}

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  .event-heading-panel-v357 { padding: 7px 8px !important; }
  .event-heading-panel-v357 .public-top-nav { margin-bottom: 4px !important; }
  .event-heading-panel-v357 .event-heading-compact { gap: 4px !important; }
  .event-heading-panel-v357 .event-title-block .eyebrow { display:none; }
  .event-heading-panel-v357 .event-title-block h1 { font-size: 1.12rem !important; line-height:1.14; margin: 0 !important; }
  .event-heading-panel-v357 .compact-event-info {
    grid-template-columns: max-content minmax(0,1fr) !important;
    gap: 2px 7px !important;
    font-size: .72rem !important;
  }
  .event-heading-panel-v357 .compact-event-info dt,
  .event-heading-panel-v357 .compact-event-info dd { padding: 1px 0 !important; }

  .event-live-now { margin: 5px 0 8px; padding: 7px; border-radius: 10px; }
  .event-live-now-heading { margin-bottom: 5px; }
  .event-live-now-heading h2 { font-size: .95rem; }
  .event-live-now-heading > span { min-width:24px; height:24px; font-size:.72rem; }
  .event-participant-search-quick { margin: 6px 0 9px; }
  .participant-event-search-launch { min-height: 50px; padding: 6px 9px; border-radius:10px; }
  .participant-event-search-launch .participant-search-icon { font-size:21px; }
  .participant-event-search-launch strong { font-size:.86rem; }
  .participant-event-search-launch small { font-size:.68rem; }

  .event-categories-primary { padding-top: 7px !important; }
  .event-section-heading-row h2 { font-size: 1.02rem !important; }
  .event-statistics-section { margin-top: 3px !important; padding-top: 0 !important; }
  .event-statistics-details > summary { min-height: 42px; font-size: .88rem; }
  .event-statistics-details:not([open]) + * { margin-top:0; }

  .category-card.category-card-compact { padding: 8px 9px !important; min-height: 58px; }
  .category-card.category-card-compact h3 { font-size: .88rem !important; line-height:1.15; }
  .category-card-state-line { font-size: .7rem; margin-top:3px; }
  .category-card-compact-meta { margin-top:3px !important; font-size:.68rem !important; }
  .category-live-badge { font-size: .62rem !important; padding: 2px 6px !important; }

  body.category-view-active .embedded-category-heading {
    padding: 6px 5px 0 !important;
    margin-bottom: 4px !important;
  }
  body.category-view-active .embedded-category-heading .category-event-name {
    margin: 0 0 2px !important;
    font-size: .66rem !important;
    white-space: nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  body.category-view-active .embedded-category-heading > h1 {
    margin: 0 0 5px !important;
    font-size: 1.02rem !important;
    line-height:1.12;
  }
  body.category-view-active .embedded-category-tabs.public-category-tabs {
    position: sticky;
    top: 0;
    z-index: 38;
    margin: 0 !important;
    padding: 3px 0 5px !important;
    background: rgba(244,246,250,.97);
    backdrop-filter: blur(7px);
  }
  body.category-view-active .embedded-category-tabs.public-category-tabs .category-screen-tab {
    min-height: 38px !important;
    padding: 6px 10px !important;
    font-size: .72rem !important;
    border-radius: 9px !important;
  }

  .participant-entry-actions-v357 { grid-template-columns: 1fr !important; }
  .participant-category-card .participant-category-status { padding: 6px 7px; }
  .participant-category-card .participant-category-status strong { font-size:.86rem; }

  .result-detail-cell { min-height: 36px; min-width:36px; }

  body.protected-online-body .protected-event-summary-v357 { padding: 6px !important; }
  body.protected-online-body .protected-event-summary-main { grid-template-columns: auto minmax(0,1fr); gap:7px; }
  body.protected-online-body .protected-back-events-compact { min-height:36px; padding:5px 7px; font-size:.7rem; }
  body.protected-online-body .protected-event-title-copy h2 { font-size:.96rem !important; }
  body.protected-online-body .protected-event-title-copy p { font-size:.68rem; }
  body.protected-online-body .protected-live-categories-primary { padding: 5px !important; }
  body.protected-online-body .protected-live-heading-row h2 { font-size: .96rem !important; }
  body.protected-online-body .protected-category-card { min-height:60px; padding:7px 8px !important; }
  body.protected-online-body .protected-category-card .category-card-title-line h3 { font-size:.86rem !important; }
  body.protected-online-body .protected-category-card .category-card-status-line,
  body.protected-online-body .protected-category-card .category-card-dance-line { font-size:.68rem !important; }
  body.protected-online-body .protected-results-nav .category-screen-tab { min-height:38px !important; padding:6px 8px !important; font-size:.72rem; }
  body.protected-online-body .protected-results-toolbar { padding:6px !important; border-radius:8px !important; }
  body.protected-online-body .protected-single-round-results-table .result-detail-cell { min-width:36px; min-height:36px; }
  body.protected-online-body .protected-single-round-results-table .unified-results-stage th { top: 32px; }
}

/* ---------- Tablet ---------- */
@media (min-width: 721px) and (max-width: 1366px) and (pointer: coarse) {
  body.category-view-active .embedded-category-tabs.public-category-tabs {
    position: sticky;
    top: 0;
    z-index: 36;
    background: rgba(244,246,250,.96);
    backdrop-filter: blur(7px);
  }
  body.category-view-active .embedded-category-tabs.public-category-tabs .category-screen-tab { min-height:42px; }
  .event-statistics-details > summary { font-size:.94rem; }
  body.protected-online-body .protected-results-nav { top:0; }
  body.protected-online-body .protected-single-round-results-table .result-detail-cell { min-width:38px; min-height:38px; }
}

@media (prefers-reduced-motion: reduce) {
  .event-statistics-details > summary::after { transition: none; }
}

/* Search results expose category context, essential when the same contest number
   is reused by different couples in different categories. */
.participant-search-category-line {
  display: block;
  margin-top: 3px;
  color: #5b285d;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.25;
  white-space: normal;
}
/* v3.6.0: fără bara de mesaje predefinite, istoricul ocupă zona flexibilă. */
.event-chat-panel{grid-template-rows:auto 1fr auto}
