:root {
  --chicago-maroon: #861f41;
  --burnt-orange: #e5751f;
  --yardline-white: #ffffff;
  --hokie-stone: #75787b;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background-color: var(--yardline-white);
  color: #333;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

header {
  background-color: var(--chicago-maroon);
  color: var(--yardline-white);
  width: 100%;
  padding: 1rem 0;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
  margin: 0;
  font-size: 1.8rem;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.screen {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

.screen.active {
  display: flex;
}

.setup-group {
  width: 100%;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.setup-group label {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--chicago-maroon);
}

select,
input {
  padding: 0.75rem;
  border: 2px solid var(--hokie-stone);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}

select:focus,
input:focus {
  border-color: var(--burnt-orange);
}

button {
  background-color: var(--burnt-orange);
  color: var(--yardline-white);
  border: none;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.1s;
  width: 100%;
  margin-top: 1rem;
}

button:hover {
  background-color: #c96013;
}

button:active {
  transform: scale(0.98);
}

.error {
  color: #d93025;
  font-weight: bold;
  margin: 0;
}

/* Game Screen */
.status-bar {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--hokie-stone);
  margin-bottom: 2rem;
}

#question-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  text-align: center;
  min-height: 250px;
  justify-content: center;
}

.question-text {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--chicago-maroon);
}

.question-image {
  max-width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 4px solid var(--chicago-maroon);
}

.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

.answer-btn {
  background-color: var(--hokie-stone);
  margin-top: 0;
  min-height: 80px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.answer-btn.correct {
  background-color: #28a745;
}

.answer-btn.wrong {
  background-color: #dc3545;
}

.answer-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.hidden {
  display: none;
}

/* Results Screen */
#results-screen h2 {
  font-size: 2.5rem;
  color: var(--chicago-maroon);
}

#final-score {
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

#final-percentage {
  font-size: 3rem;
  font-weight: bold;
  color: var(--burnt-orange);
  margin: 0 0 2rem 0;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 0;
}

.checkbox-label input {
  display: none;
}
.pill-text {
  display: inline-block;
  padding: 8px 16px;
  background-color: #eee;
  color: #555;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  user-select: none;
}
.checkbox-label input:checked + .pill-text {
  background-color: var(--burnt-orange);
  color: white;
}

.group-label {
  font-weight: bold;
  margin-bottom: 5px;
  display: block;
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.group-label {
  margin-bottom: 0; /* Override previous margin */
}

.group-actions {
  display: flex;
  gap: 4px;
}

.filter-action {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  color: var(--chicago-maroon);
  text-decoration: none;
  font-weight: 600;
}
.filter-action:hover {
  text-decoration: underline;
}

.setup-accordion {
  margin-bottom: 20px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.setup-accordion summary {
  padding: 12px;
  font-weight: bold;
  cursor: pointer;
  background: #eee;
  user-select: none;
}

.accordion-content {
  padding: 15px;
  border-top: 1px solid #ddd;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
}

#num-questions-display {
  font-weight: bold;
  color: var(--chicago-maroon);
}

.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.mode-btn {
  padding: 12px;
  background-color: var(--burnt-orange);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.mode-btn:hover {
  background-color: #c96010;
}

#share-btn {
  background-color: var(--hokie-stone);
  margin-bottom: 10px;
}

#share-btn:hover {
  background-color: #5a5c5e;
}

.hard-mode-group {
  margin-top: 10px;
  margin-bottom: 25px;
}
.toggle-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 12px;
}
.toggle-switch input {
  display: none;
}
.toggle-slider {
  position: relative;
  width: 50px;
  height: 28px;
  background-color: #ccc;
  border-radius: 28px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: white;
  top: 3px;
  left: 3px;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background-color: var(--chicago-maroon);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
.toggle-label {
  font-weight: bold;
  color: #333;
  font-size: 1rem;
}

/* Modal Styles */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.modal {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  z-index: 1001;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal.hidden {
  display: flex; /* Keep flex so transition works */
  transform: translateY(100%);
  pointer-events: none;
}
.overlay.hidden {
  display: block; /* Keep block for transition */
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 0 20px 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 10px 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--chicago-maroon);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #888;
  padding: 0;
  margin: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  background-color: #f1f1f1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.setup-header-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.settings-btn {
  background-color: #f1f1f1;
  color: #333;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  width: auto;
  margin: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.settings-btn:hover {
  background-color: #e5e5e5;
}

/* Cleanup old details accordion */
.setup-accordion,
.accordion-content {
  display: none;
}

/* Roster Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-modal.hidden {
  display: none !important;
}
.image-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  border: 4px solid var(--burnt-orange);
}
