.draft-controls-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin: 1.2rem 0 1.2rem 0;
}
.draft-controls-row .btn {
  min-width: 120px;
  font-size: 1.08rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px #fc575e18;
}
@media (max-width: 700px) {
  .draft-controls-row {
    flex-direction: column;
    gap: 0.7rem;
    align-items: stretch;
  }
}
body.dark-mode .draft-card .team-picks.latest-pick {
  animation: pick-bounce 0.3s cubic-bezier(.4,1.6,.6,1) 1;
  z-index: 2;
}

.draft-card .team-picks.latest-pick {
  animation: pick-bounce 0.3s cubic-bezier(.4,1.6,.6,1) 1;
  z-index: 2;
}

@keyframes pick-bounce {
  0% { transform: scale(1); }
  20% { transform: scale(1.08); }
  60% { transform: scale(1.13); }
  80% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
/* Settings button (cog) */
#settings-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 20;
  padding: 0.2rem;
  transition: filter 0.2s;
}
#settings-btn:hover svg {
  filter: drop-shadow(0 0 4px #fc575e88);
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.hidden { display: none !important; }
.modal-content {
  background: #fff6e0;
  border-radius: 14px;
  box-shadow: 0 4px 32px #fc575e33;
  padding: 2.2rem 2.5rem 1.5rem 2.5rem;
  min-width: 270px;
  max-width: 90vw;
  text-align: center;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin: 1.2rem 0 0.5rem 0;
}
body.dark-mode, .modal-content.dark-mode {
  background: #23232b !important;
  color: #fff !important;
}
body.dark-mode .container,
body.dark-mode #draft-board,
body.dark-mode #results-board {
  background: #23232b !important;
  color: #fff !important;
}
body.dark-mode .draft-card,
body.dark-mode .modal-content {
  background: #2d2d38 !important;
  color: #fff !important;
  border-color: #444 !important;
}
body.dark-mode .team-name { color: #f7b42c !important; }
body.dark-mode .btn, body.dark-mode button {
  background: linear-gradient(90deg,#fc575e 60%,#f7b42c 100%) !important;
  color: #fff !important;
}
body.dark-mode .latest-pick {
  background: linear-gradient(90deg,#f7b42c 60%,#fc575e 100%) !important;
  color: #23232b !important;
  border-color: #f7b42c !important;
}
body.dark-mode input,
body.dark-mode input[type="text"],
body.dark-mode input[type="number"],
body.dark-mode textarea {
  background: #18181d !important;
  color: #fff !important;
  border: 2px solid #f7b42c !important;
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #eee !important;
  opacity: 1 !important;
}
body.dark-mode label,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode .setup-label,
body.dark-mode .setup-error,
body.dark-mode #setup-error,
body.dark-mode .team-name,
body.dark-mode .setting-row label {
  color: #fff !important;
}
body.dark-mode li,
body.dark-mode .list li {
  color: #23232b !important;
}
body.dark-mode #team-list li,
body.dark-mode #person-list li {
  color: #23232b !important;
}
body.dark-mode .draft-card {
  background: #23232b !important;
  color: #fff !important;
  border-color: #f7b42c !important;
}
body.dark-mode .draft-card .team-picks {
  background: #18181d !important;
  color: #fff !important;
  border: 1.5px solid #444 !important;
}
body.dark-mode .draft-card .team-picks.latest-pick {
  background: #fff !important;
  color: #23232b !important;
  border-color: #f7b42c !important;
}
body.dark-mode .draft-card .team-picks.latest-pick {
  color: #111 !important;
}
/* Highlight and animate the latest pick in draft card layout */
.draft-card .team-picks.latest-pick {
  background: linear-gradient(90deg, #f7b42c 60%, #fc575e 100%) !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 0 0 3px #fc575e88, 0 2px 12px #fc575e33 !important;
  border: 2px solid #fc575e !important;
  z-index: 3;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border 0.2s;
}

.card-animate {
  animation: card-bounce 0.7s cubic-bezier(.4,1.6,.6,1) 1;
  z-index: 2;
}

@keyframes card-bounce {
  0% { transform: scale(1); }
  20% { transform: scale(1.08); }
  60% { transform: scale(1.13); }
  80% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
/* Responsive: On small screens, show draft board as flex cards instead of table */
@media (max-width: 700px) {
  #draft-board .scroll-x {
    display: flex !important;
    flex-wrap: wrap;
    gap: 1rem;
    overflow-x: visible !important;
    background: none;
    box-shadow: none;
    padding: 0;
  }
  #draft-board table {
    display: none !important;
  }
  .draft-card {
    background: #fff6e0;
    border-radius: 12px;
    box-shadow: 0 2px 12px #fc575e18;
    min-width: 140px;
    margin-bottom: 1rem;
    padding: 0.7rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: #fc575e;
  }
  .draft-card .team-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fc575e;
  }
  .draft-card .team-picks {
    font-size: 1rem;
    color: #f7b42c;
    text-align: center;
    margin-bottom: 0.2rem;
  }
}
/* Always wrap tables in a scrollable container */
.scroll-x {
  overflow-x: auto !important;
  width: 100%;
  min-height: 1px;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: #fc575e #fff6e0;
  scrollbar-width: thin;
}

/* Always show horizontal scrollbar for scroll-x, even if not needed (for clarity) */
.scroll-x::-webkit-scrollbar {
  height: 10px;
  background: #fff6e0;
}
.scroll-x::-webkit-scrollbar-thumb {
  background: #fc575e88;
  border-radius: 6px;
}
@keyframes fadeInRow {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#draft-board tr, #results-board tr {
  animation: fadeInRow 0.5s ease;
}

.latest-pick {
  background: linear-gradient(90deg, #f7b42c 60%, #fc575e 100%) !important;
  color: #fff !important;
  font-weight: 700;
  animation: highlightPick 1.2s cubic-bezier(.4,2,.6,1) 1;
}
@keyframes highlightPick {
  0% { background: #fff6e0; color: #fc575e; }
  40% { background: #fc575e; color: #fff; }
  100% { background: linear-gradient(90deg, #f7b42c 60%, #fc575e 100%); color: #fff; }
}
body {
  font-family: 'Quicksand', 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f7b42c 0%, #fc575e 100%);
  min-height: 100vh;
}
.container {
  max-width: 800px;
  margin: 2.5rem auto;
  background: rgba(255,255,255,0.97);
  border-radius: 18px;
  box-shadow: 0 6px 32px #fc575e33, 0 1.5px 8px #f7b42c33;
  padding: 2.5rem 2rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}
h1 {
  text-align: center;
  font-size: 2.5rem;
  letter-spacing: 2px;
  color: #fc575e;
  margin-bottom: 0.5rem;
  font-weight: 800;
  text-shadow: 0 2px 8px #f7b42c44;
}
h2 {
  text-align: center;
  color: #f7b42c;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}
h3 {
  color: #fc575e;
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.hidden { display: none; }
.flex {
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.list {
  margin: 1rem 0 0.5rem 0;
  padding: 0;
  list-style: none;
}
.list li {
  background: #fff6e0;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px #f7b42c22;
  font-size: 1.08rem;
  transition: background 0.2s;
}
.list li:hover {
  background: #ffe3c0;
}
.list button {
  margin-left: 0.5rem;
  background: #fc575e;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.2rem 0.7rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.list button:hover {
  background: #f7b42c;
  color: #fc575e;
  transform: scale(1.08);
}
form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
input[type="text"] {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1.5px solid #fc575e;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border 0.2s;
}
input[type="text"]:focus {
  border: 1.5px solid #f7b42c;
}
button, .btn {
  background: linear-gradient(90deg, #fc575e 60%, #f7b42c 100%);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 0.5rem 1.2rem;
  font-size: 1.08rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px #fc575e22;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  transition: background 0.2s, transform 0.1s;
}
button:hover, .btn:hover {
  background: linear-gradient(90deg, #f7b42c 60%, #fc575e 100%);
  color: #fc575e;
  transform: scale(1.05);
}
#error, #setup-error, .error {
  color: #fc575e;
  background: #fff0f0;
  border-left: 4px solid #fc575e;
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  margin: 0.7rem 0 0.5rem 0;
  font-size: 1.05rem;
  display: none;
}
#error.active, #setup-error.active, .error.active {
  display: block;
}
#draft-board, #results-board {
  margin-bottom: 1.5rem;
  width: 100%;
  min-height: 120px;
}
#draft-board table, #results-board table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px #fc575e18;
  overflow: hidden;
  margin-bottom: 1.2rem;
  min-width: 600px;
}
#draft-board th, #results-board th {
  background: linear-gradient(90deg, #f7b42c 60%, #fc575e 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.7rem 0.3rem;
  border: none;
  text-align: center;
}
#draft-board td, #results-board td {
  background: #fff6e0;
  color: #fc575e;
  font-size: 1.05rem;
  padding: 0.5rem 0.2rem;
  border: none;
  text-align: center;
  transition: background 0.2s;
}
#draft-board tr:nth-child(even) td, #results-board tr:nth-child(even) td {
  background: #ffe3c0;
}
#draft-board tr:hover td, #results-board tr:hover td {
  background: #f7b42c33;
}
#draft-board th:first-child, #results-board th:first-child {
  border-top-left-radius: 12px;
}
#draft-board th:last-child, #results-board th:last-child {
  border-top-right-radius: 12px;
}
#draft-board tr:last-child td:first-child, #results-board tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}
#draft-board tr:last-child td:last-child, #results-board tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}
#draft-progress {
  text-align: center;
  font-size: 1.15rem;
  color: #fc575e;
  margin-bottom: 1rem;
  font-weight: 600;
}
#remaining-people {
  text-align: center;
  color: #f7b42c;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) {
  .container {
    max-width: 98vw;
    margin: 1rem;
    padding: 0.7rem;
    border-radius: 10px;
  }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.2rem; }
  .flex { flex-direction: column; gap: 1rem; }
  #draft-board > div, #results-board > div { min-width: 100px; padding: 0.5rem 0.3rem; }
  form, input[type="text"], button, .btn {
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .container {
    max-width: 100vw;
    margin: 0;
    padding: 0.3rem;
    border-radius: 0;
    box-shadow: none;
  }
  h1 { font-size: 1.3rem; }
  h2 { font-size: 1rem; }
  .flex { flex-direction: column; gap: 0.5rem; }
  .list li, .list button, form, input[type="text"], button, .btn {
    font-size: 0.95rem;
    padding: 0.3rem 0.5rem;
  }
  #draft-board table, #results-board table {
    min-width: 500px;
    font-size: 0.95rem;
  }
}
.confetti {
  position: absolute;
  pointer-events: none;
  width: 100%;
  height: 100%;
  top: 0; left: 0;
  z-index: 0;
  overflow: hidden;
}
.confetti span {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  opacity: 0.7;
  background: var(--color);
  top: var(--top);
  left: var(--left);
  animation: confetti-fall 2.5s linear infinite;
}
@keyframes confetti-fall {
  0% { transform: translateY(-30px) rotate(0deg); }
  100% { transform: translateY(100vh) rotate(360deg); }
}
.pick-bounce-animate {
  animation: pick-bounce 0.3s cubic-bezier(.4,1.6,.6,1) 1;
  z-index: 2;
}
