/* Competition Manager — Public Styles */

.cm-public { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; max-width: 900px; margin: 0 auto; }

/* ── LIVE ── */
.cm-live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: #1e3a5f;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px 10px 0 0;
}
.cm-live-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.cm-live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #4ade80;
  animation: cm-blink 1.2s ease-in-out infinite;
}
@keyframes cm-blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.cm-live-meta { font-size: 13px; opacity: .8; }

.cm-city-block { margin-bottom: 30px; }
.cm-city-title {
  font-size: 18px; font-weight: 700;
  padding: 10px 16px;
  background: #f0f4ff;
  border-left: 4px solid #1d4ed8;
  margin-bottom: 0;
}

.cm-table {
  width: 100%; border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
}
.cm-table thead th {
  background: #f9fafb;
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid #e5e7eb;
}
.cm-table tbody tr { border-bottom: 1px solid #f3f4f6; transition: background .1s; }
.cm-table tbody tr:hover { background: #f8faff; }
.cm-table tbody td { padding: 10px 14px; font-size: 14px; }
.cm-table .rank-1 { background: #fefce8; font-weight: 600; }
.cm-table .rank-2 { background: #fafafa; }
.cm-medal { font-size: 18px; }
.cm-rank-num { display:inline-block; width:24px; height:24px; border-radius:50%; background:#e5e7eb; text-align:center; line-height:24px; font-size:12px; font-weight:600; color:#374151; }
.cm-solved { font-size: 18px; font-weight: 700; color: #1d4ed8; text-align: center; }
.cm-best { color: #059669; font-weight: 600; }
.cm-time { color: #6b7280; font-size: 13px; }
.cm-loading { padding: 30px; text-align: center; color: #9ca3af; font-size: 14px; }
.cm-empty { text-align: center; padding: 20px; color: #9ca3af; font-size: 13px; }
.cm-empty-global { text-align: center; padding: 40px; color: #9ca3af; }

/* ── FINAL ── */
.cm-final-header { text-align: center; padding: 32px 20px 16px; }
.cm-trophy { font-size: 56px; display: block; margin-bottom: 10px; }
.cm-final-title { font-size: 28px; font-weight: 800; color: #1e3a5f; margin: 0 0 6px; }
.cm-final-sub { color: #6b7280; font-size: 14px; margin: 0; }

.cm-final-city { margin-bottom: 40px; }
.cm-final-city-name { font-size: 20px; font-weight: 700; margin: 20px 0 16px; padding-bottom: 8px; border-bottom: 2px solid #e5e7eb; }

/* Podium */
.cm-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 30px;
  min-height: 200px;
}
.cm-podium-slot { display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 180px; }
.cm-podium-name { font-weight: 700; font-size: 14px; text-align: center; margin-bottom: 6px; color: #1e3a5f; }
.cm-podium-solved { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.cm-podium-block {
  width: 100%; border-radius: 6px 6px 0 0;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12px;
}
.cm-podium-label { font-size: 18px; font-weight: 700; }
.cm-podium-gold   .cm-podium-block { background: linear-gradient(160deg, #fde68a, #f59e0b); }
.cm-podium-silver .cm-podium-block { background: linear-gradient(160deg, #e5e7eb, #9ca3af); }
.cm-podium-bronze .cm-podium-block { background: linear-gradient(160deg, #fed7aa, #d97706); }

/* Final table */
.cm-final-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.cm-final-table thead th { background: #1e3a5f; color: #fff; padding: 11px 14px; font-size: 12px; text-align: left; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.cm-final-table tbody tr { border-bottom: 1px solid #f3f4f6; }
.cm-final-table .rank-1 { background: #fefce8; }
.cm-final-table .rank-2 { background: #f9fafb; }
.cm-final-table .rank-3 { background: #fff7ed; }
.cm-final-table td { padding: 11px 14px; font-size: 14px; }
.cm-final-rank { font-size: 20px; }
.cm-final-team { font-weight: 600; color: #1e3a5f; }
.cm-final-count { font-size: 20px; font-weight: 800; color: #1d4ed8; text-align: center; }
.cm-final-qs { font-size: 12px; color: #6b7280; }
.cm-final-time { font-size: 13px; color: #374151; font-weight: 500; }

.cm-final-footer { text-align: center; padding: 20px; font-size: 12px; color: #9ca3af; border-top: 1px solid #f3f4f6; margin-top: 20px; }

@media (max-width: 600px) {
  .cm-podium { gap: 4px; }
  .cm-podium-name { font-size: 12px; }
  .cm-final-table td, .cm-table td { padding: 8px 8px; font-size: 13px; }
  .cm-live-header { flex-direction: column; }
}
