.cbc-root { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
/* Force readable colors regardless of theme */
.cbc-root,
.cbc-root * {
  color: #000 !important;
}

.cbc-hidden { opacity: 0; height: 0; overflow: hidden; pointer-events: none; }
.cbc-fade-in { animation: cbc-fade-in 0.5s ease both; }

@keyframes cbc-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Loading screen */
.cbc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  transition: opacity 0.4s ease;
}
.cbc-loading.is-fading { opacity: 0; }

.cbc-loading-cookie {
  font-size: 56px;
  animation: cbc-spin 1.8s ease-in-out infinite;
}

.cbc-loading-text {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 600;
  opacity: 0.7;
}

@keyframes cbc-spin {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

.cbc-root .cbc-subtitle,
.cbc-root .cbc-footnote,
.cbc-root .cbc-matchup-label {
  opacity: 0.8;
}
.cbc-header { margin-bottom: 8px; }
.cbc-title { font-size: 20px; font-weight: 700; }
.cbc-subtitle { font-size: 13px; opacity: 0.75; }

.cbc-bracket-wrap { position: relative; overflow: hidden; padding: 10px; border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; }
.cbc-bracket { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; position: relative; z-index: 2; }
.cbc-lines { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

.cbc-round { display: flex; flex-direction: column; }
.cbc-round-title { font-weight: 700; font-size: 13px; margin: 0 0 4px 0; }
.cbc-round-list { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: 4px; }

.cbc-matchup { background: #fff; border: 1px solid rgba(0,0,0,0.10); border-radius: 8px; padding: 5px 7px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.cbc-matchup.is-open { border: 2px solid #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 2px 8px rgba(37, 99, 235, 0.10); }
.cbc-matchup.is-locked { opacity: 0.6; }
.cbc-matchup-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.cbc-matchup-label { font-size: 11px; opacity: 0.8; }
.cbc-badge { font-size: 10px; padding: 1px 6px; border-radius: 999px; border: 1px solid rgba(0,0,0,0.10); }
.cbc-matchup.is-open .cbc-badge { background: rgba(37, 99, 235, 0.10); border-color: rgba(37, 99, 235, 0.3); color: #1d4ed8 !important; font-weight: 700; }

.cbc-email-wrap { margin-bottom: 4px; }
.cbc-email-wrap.is-hidden { display: none; }
.cbc-email-label { font-size: 10px; opacity: 0.7; margin-bottom: 1px; }
.cbc-email { width: 100%; padding: 4px 6px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.15); font-size: 12px; box-sizing: border-box; }

.cbc-choices { display: grid; grid-template-columns: 1fr 24px 1fr; gap: 3px; align-items: center; }
.cbc-vs { text-align: center; font-weight: 700; font-size: 11px; opacity: 0.6; }

.cbc-choice { width: 100%; padding: 4px 6px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.12); background: #fafafa; cursor: pointer; text-align: left; box-sizing: border-box; }
.cbc-choice:hover { background: #f3f3f3; }
.cbc-choice.is-disabled { cursor: default; opacity: 0.7; -webkit-user-select: none; user-select: none; pointer-events: none; }
.cbc-choice.is-winner { background: rgba(22, 163, 74, 0.10); border-color: rgba(22, 163, 74, 0.4); opacity: 1; }
.cbc-choice.is-winner .cbc-choice-name { color: #166534 !important; }
.cbc-choice.is-winner .cbc-choice-count { color: #166534 !important; }
.cbc-choice.is-loser { position: relative; opacity: 0.85; }
.cbc-choice.is-loser > * { opacity: 0.35; }
.cbc-choice.is-loser::after {
  content: '\1F480';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  z-index: 2;
  pointer-events: none;
}
.cbc-choice-name { font-weight: 700; font-size: 13px; }
.cbc-choice-by { font-size: 12px; margin-top: 1px; color: #426DA9; }
.cbc-choice-count { font-size: 10px; opacity: 0.75; margin-top: 1px; }
.cbc-choice-count.is-hidden { visibility: hidden; }

.cbc-third-divider { height: 1px; background: rgba(0,0,0,0.08); margin: 6px 0 4px; }
.cbc-third-title { margin-top: 0; }

.cbc-line { fill: none; stroke: rgba(0,0,0,0.18); stroke-width: 2; }
.cbc-line-third { stroke-dasharray: 4 4; opacity: 0.65; }

.cbc-footnote { font-size: 11px; opacity: 0.7; margin-top: 6px; }

.cbc-mobile { display: none; margin-top: 14px; }
.cbc-mobile-round { margin: 18px 0 8px; font-size: 16px; }

/* Selected vote styling */
.cbc-choice.is-selected {
  border: 2px solid #2563eb;              /* blue */
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cbc-matchup.is-locked .cbc-choice.is-selected {
  border-color: rgba(0,0,0,0.12) !important;
  box-shadow: none !important;
}

.cbc-choice.is-winner.is-selected {
  background: rgba(22, 163, 74, 0.10);
  border-color: rgba(22, 163, 74, 0.4);
  box-shadow: none;
}

/* Full-screen confetti toast */
.cbc-confetti-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  overflow: hidden;
}
.cbc-confetti-overlay.is-active { opacity: 1; }
.cbc-confetti-overlay.is-fading { opacity: 0; }

.cbc-confetti-label {
  font-size: 42px;
  font-weight: 900;
  color: #166534 !important;
  background: rgba(255,255,255,0.92);
  padding: 18px 48px;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  z-index: 2;
  animation: cbc-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transition: opacity 0.35s ease;
  max-width: 500px;
  text-align: center;
}
.cbc-confetti-label.is-fading { opacity: 0; }
.cbc-confetti-label.cbc-confetti-subtext {
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
  animation: cbc-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.cbc-confetti-piece {
  position: absolute;
  top: -40px;
  z-index: 1;
  animation: cbc-fall linear forwards;
  will-change: transform;
}

@keyframes cbc-pop {
  0%   { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes cbc-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Podium */
.cbc-podium { margin-top: 16px; }
.cbc-podium.is-hidden { display: none; }
.cbc-podium-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  max-width: 420px;
  margin: 0 auto;
}

.cbc-podium-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 130px;
}

.cbc-podium-name {
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  margin-bottom: 6px;
  word-break: break-word;
}

.cbc-podium-pedestal {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px 6px 0 0;
  font-weight: 800;
  color: #fff !important;
}

.cbc-podium-place {
  font-size: 16px;
  color: #fff !important;
}

.cbc-pedestal-gold {
  background: linear-gradient(180deg, #facc15, #ca8a04);
  height: 80px;
}

.cbc-pedestal-silver {
  background: linear-gradient(180deg, #d1d5db, #9ca3af);
  height: 58px;
}

.cbc-pedestal-bronze {
  background: linear-gradient(180deg, #d97706, #92400e);
  height: 42px;
}

@media (max-width: 860px) {
  .cbc-bracket-wrap { display: none; }
  .cbc-mobile { display: block; }
}

