/* Styles for CBB Pick'em */
.cbb-jersey {
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25));
}

/* Pick row: slot badge | matchup | controls */
.cbb-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.cbb-row.locked-row { background: #f1f3f5; }
.cbb-slot {
  flex: 0 0 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #212529;
  color: #fff;
}
.cbb-slot-num { font-size: 22px; font-weight: 700; line-height: 1; }
.cbb-slot-pts { font-size: 11px; opacity: .8; }
.cbb-row-main { flex: 1 1 auto; min-width: 0; }
.cbb-row-controls {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.drag-handle {
  cursor: grab;
  touch-action: none;
  user-select: none;
  padding: 4px 8px;
  color: #6c757d;
  letter-spacing: -3px;
  font-size: 18px;
}

.cbb-matchup {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.cbb-vs {
  align-self: center;
  font-weight: 600;
  color: #333;
}
.cbb-team-btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cbb-team-btn:disabled { cursor: default; opacity: .85; }
.cbb-team-btn:not(:disabled):hover { border-color: #b6d4fe; }
.cbb-team-btn.selected {
  border-color: #0d6efd;
  background: #cfe2ff;
}
.cbb-team-name { overflow-wrap: anywhere; }

/* Hidden future feature container (progress bars / distribution). Kept hidden by default) */
.hidden-feature {
  display: none;
}

/* Mobile: stack the two teams so nothing runs off screen */
@media (max-width: 576px) {
  .cbb-row { gap: 8px; padding: 10px; }
  .cbb-slot { flex-basis: 38px; }
  .cbb-matchup { flex-direction: column; gap: 4px; }
  .cbb-vs { align-self: flex-start; font-size: 12px; padding-left: 8px; }
  .cbb-jersey { width: 56px; height: 56px; }
  .cbb-team-btn { padding: 8px; min-height: 64px; }
  .cbb-row-controls .btn { padding: 6px 10px; }
}

/* Accessibility helpers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Game info stacked on the left: date/time, venue, special note, preview link */
.cbb-note { font-size: .8rem; font-weight: 600; color: #b02a37; }
@media (max-width: 576px) {
  .cbb-note { font-size: .7rem; }
}


/* Final-game result colouring for the picked team */
.cbb-team-btn.selected.result-win {
  border-color: #146c43;
  background: #d1e7dd;
}
.cbb-team-btn.selected.result-loss {
  border-color: #b02a37;
  background: #f8d7da;
}
/* Started games the user did not pick: no blue shading or outline */
.cbb-row.locked-row .cbb-team-btn:not(.selected) {
  background: transparent;
  border-color: transparent;
}


/* Group picks: freeze the first (User) column while the table scrolls sideways.
   The table background is set once here; the frozen cells reuse it so they stay
   opaque and match the rest of the table. */
.group-picks-table { --bs-table-bg: #f8f9fa; }
.group-picks-table th:first-child,
.group-picks-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background-color: var(--bs-table-bg);
  border-right: 1px solid #dee2e6;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-picks-table thead th:first-child { z-index: 2; }

/* Leaderboard collapsible weeks */
.cbb-week-toggle { cursor: pointer; user-select: none; }
.cbb-week-toggle .cbb-chevron { display: inline-block; transition: transform .15s; }
.cbb-week-toggle:not(.collapsed) .cbb-chevron { transform: rotate(90deg); }

/* Week-winner celebration */
#confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2000; }
.cbb-balls { display: flex; justify-content: space-around; padding-top: 12px; font-size: 2rem; }
.cbb-ball { display: inline-block; animation: cbb-bounce .8s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes cbb-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-28px); } }
.no-motion .cbb-ball { animation: none; }
@media (prefers-reduced-motion: reduce) { .cbb-ball { animation: none; } }

/* ===== Theme: navy + basketball orange + hardwood ===== */
:root {
  --cbb-navy: #0b1f3a;
  --cbb-navy-2: #13315c;
  --cbb-orange: #f26a1b;
  --cbb-orange-dark: #d4540b;
  --cbb-wood: #e8c99a;
  --cbb-gold: #ffc72c;
  --cbb-display: 'Oswald', 'Arial Narrow', 'Roboto Condensed', Impact, sans-serif;
}
h1, h2, h3, h4, .navbar-brand { font-family: var(--cbb-display); letter-spacing: .01em; }

.btn-primary {
  --bs-btn-bg: var(--cbb-orange);
  --bs-btn-border-color: var(--cbb-orange);
  --bs-btn-hover-bg: var(--cbb-orange-dark);
  --bs-btn-hover-border-color: var(--cbb-orange-dark);
  --bs-btn-active-bg: var(--cbb-orange-dark);
  --bs-btn-active-border-color: var(--cbb-orange-dark);
  --bs-btn-disabled-bg: var(--cbb-orange);
  --bs-btn-disabled-border-color: var(--cbb-orange);
  --bs-btn-focus-shadow-rgb: 242, 106, 27;
}

.cbb-navbar {
  background: var(--cbb-navy);
  border-bottom: 4px solid var(--cbb-orange);
}
.cbb-brand { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cbb-brand-ball { display: inline-block; }
.cbb-navbar .nav-link:hover, .cbb-navbar .nav-link:focus { color: var(--cbb-gold); }

/* ===== Home page hero ===== */
.cbb-hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 20px 16px 12px;
  color: #fff;
  background: linear-gradient(160deg, var(--cbb-navy) 0%, var(--cbb-navy-2) 100%);
  box-shadow: 0 6px 18px rgba(11, 31, 58, .35);
}
.cbb-court {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .14;
  pointer-events: none;
}
.cbb-hero > *:not(.cbb-court):not(.cbb-float) { position: relative; z-index: 1; }

.cbb-float {
  position: absolute;
  z-index: 0;
  font-size: 1.6rem;
  opacity: .85;
  animation: cbb-float 6s ease-in-out infinite;
}
.cbb-float-1 { top: 10%; left: 4%; }
.cbb-float-2 { top: 34%; right: 4%; animation-delay: -2s; }
.cbb-float-3 { bottom: 24%; left: 10%; animation-delay: -4s; }
@keyframes cbb-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(25deg); }
}

/* Scoreboard */
.cbb-scoreboard {
  max-width: 640px;
  margin: 0 auto 18px;
  padding: 10px 14px 14px;
  text-align: center;
  background: #05080f;
  border: 3px solid #39465a;
  border-radius: 12px;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .8), 0 3px 0 #1c2433;
}
.cbb-sb-title {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 5vw, 2.1rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--cbb-gold);
  text-shadow: 0 0 10px rgba(255, 199, 44, .55);
}
.cbb-sb-row { display: flex; gap: 8px; justify-content: center; }
.cbb-sb-cell {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 4px;
  background: #0e1420;
  border: 1px solid #2a3547;
  border-radius: 8px;
}
.cbb-sb-label {
  display: block;
  font-size: .65rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #8fa0b8;
}
.cbb-led {
  display: block;
  font-family: var(--cbb-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 4.5vw, 1.8rem);
  line-height: 1.2;
  text-transform: uppercase;
  color: #ffb000;
  text-shadow: 0 0 8px rgba(255, 176, 0, .7);
  overflow-wrap: anywhere;
}

.cbb-hero-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 28px;
}
.cbb-hero-copy { flex: 1 1 280px; max-width: 480px; text-align: center; }
.cbb-tagline { font-size: 1.1rem; margin-bottom: 16px; }
.cbb-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cbb-cta .btn { font-family: var(--cbb-display); text-transform: uppercase; letter-spacing: .05em; }
.cbb-no-week { margin: 14px 0 0; color: #c9d4e4; }

/* Hoop + ball animation: the ball arcs in, swishes through and the net wiggles */
.cbb-hoop { flex: 0 1 240px; width: 240px; max-width: 70%; height: auto; }
.cbb-ball { transform: translate(160px, 125px); animation: cbb-shot 4s ease-in-out infinite; }
@keyframes cbb-shot {
  0%   { transform: translate(20px, 285px); opacity: 0; }
  8%   { opacity: 1; }
  30%  { transform: translate(80px, 40px); }
  45%  { transform: translate(150px, 55px); }
  55%  { transform: translate(160px, 100px); }
  65%  { transform: translate(160px, 150px); }
  80%  { transform: translate(166px, 230px); opacity: 1; }
  90%  { transform: translate(170px, 285px); opacity: 0; }
  100% { transform: translate(170px, 285px); opacity: 0; }
}
.cbb-net { transform-origin: 160px 100px; animation: cbb-swish 4s ease-in-out infinite; }
@keyframes cbb-swish {
  0%, 52% { transform: scale(1, 1); }
  58% { transform: scale(1.12, .94); }
  65% { transform: scale(.95, 1.08); }
  72%, 100% { transform: scale(1, 1); }
}

/* Band strip + pom poms */
.cbb-band {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  padding-top: 8px;
  border-top: 2px dashed rgba(255, 255, 255, .25);
  font-size: 1.8rem;
}
.cbb-band-note { display: inline-block; animation: cbb-hop 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * .15s); }
@keyframes cbb-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.cbb-pom { width: 54px; height: 54px; flex: 0 0 auto; transform-origin: 50% 90%; animation: cbb-shake 1.6s ease-in-out infinite; }
.cbb-pom-flip { transform: scaleX(-1); animation-delay: -.8s; }
@keyframes cbb-shake { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }

@media (max-width: 576px) {
  .cbb-hero { padding: 14px 10px 10px; }
  .cbb-hoop { width: 200px; }
  .cbb-band { font-size: 1.5rem; gap: 8px; }
  .cbb-pom { width: 44px; height: 44px; }
}

/* Skip all decorative motion; the ball rests in the net */
@media (prefers-reduced-motion: reduce) {
  .cbb-float, .cbb-ball, .cbb-net, .cbb-band-note, .cbb-pom { animation: none !important; }
}
/* ===== Stage 3: app-wide styling ===== */
main.container > h1, main.container > h2 {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--cbb-navy);
  padding-bottom: .25rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--cbb-orange);
  display: inline-block;
}
main.container h3 { color: var(--cbb-navy); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-top: 1.25rem; }
main.container a { color: var(--cbb-navy-2); }
main.container a:hover { color: var(--cbb-orange-dark); }
main.container .btn { text-decoration: none; }
main.container .btn-outline-light { color: #fff; }

.card { border: 0; border-radius: 14px; box-shadow: 0 3px 12px rgba(11, 31, 58, .15); }
.card-title { color: var(--cbb-navy); }
.list-group-item.cbb-row { border-left: 4px solid var(--cbb-wood); }
.cbb-slot { background: var(--cbb-navy); color: var(--cbb-gold); font-family: var(--cbb-display); }
.form-control:focus, .form-select:focus { border-color: var(--cbb-orange); box-shadow: 0 0 0 .2rem rgba(242, 106, 27, .25); }

/* Tables: navy header row */
main.container .table > thead > tr > th {
  background: var(--cbb-navy);
  color: #fff;
  font-family: var(--cbb-display);
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 0;
}
main.container .table { border-radius: 10px; overflow: hidden; }

/* Leaderboard medals: soft tints with dark text kept readable */
.table > tbody > tr.cbb-medal-gold > * { background-color: #fff3c4; --bs-table-bg-state: #fff3c4; box-shadow: none; font-weight: 600; }
.table > tbody > tr.cbb-medal-silver > * { background-color: #e6e9ee; --bs-table-bg-state: #e6e9ee; box-shadow: none; font-weight: 600; }
.table > tbody > tr.cbb-medal-bronze > * { background-color: #f3dcc3; --bs-table-bg-state: #f3dcc3; box-shadow: none; font-weight: 600; }
.table > tbody > tr.cbb-medal-gold > td:first-child { border-left: 5px solid #e0a800; }
.table > tbody > tr.cbb-medal-silver > td:first-child { border-left: 5px solid #8d97a5; }
.table > tbody > tr.cbb-medal-bronze > td:first-child { border-left: 5px solid #b0652b; }

/* Footer */
.cbb-footer {
  background: var(--cbb-navy);
  color: #c9d4e4;
  padding: 14px 0;
  border-top: 4px solid var(--cbb-orange);
}