/* Ticket / exam question card — reference: one dark panel (image + question + options), number buttons below */
.tickets-bloc {
  --tickets-surface: #1a3a44;
}

/* “container py-4” — vertical rhythm like Bootstrap .py-4 */
.tickets-bloc.container.py-4 {
  max-width: 100%;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}

/* Single dark card: image, question, and read-only answer grid */
.tickets-main-card {
  position: relative;
  background: var(--tickets-surface);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 0 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.tickets-prompt {
  position: relative;
}

.tickets-explained-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 30;
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 50%;
  background-color: #295969;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: background-color 0.15s, transform 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tickets-explained-btn:hover {
  background-color: #1a3a44;
  transform: scale(1.05);
}

.tickets-explained-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 12000;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  box-sizing: border-box;
}

.tickets-explained-modal[aria-hidden="false"] {
  display: flex;
}

.tickets-explained-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  border: none;
  padding: 0;
  cursor: pointer;
}

.tickets-explained-modal-panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 10px;
  max-width: 640px;
  width: 100%;
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.tickets-explained-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.tickets-explained-modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #1a3a44;
  font-weight: 700;
}

.tickets-explained-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  color: #1c3146;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.tickets-explained-modal-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.6;
  color: #334155;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Image + question only (no separate background — .tickets-main-card paints) */
.tickets-prompt {
  margin: 0;
  background: transparent;
}

.tickets-prompt .tickets-image-box {
  margin: 0;
  background: transparent;
}

.tickets-prompt .tickets-question-overlay {
  margin: 0;
  border-radius: 0;
  background: transparent;
}

.tickets-question-overlay {
  color: #fff;
  padding: 0.65rem 2.75rem 1rem 1rem;
  font-size: 16px;
  line-height: 1.55;
  font-family: inherit;
  text-align: center;
  font-weight: 600;
}

.tickets-question-overlay .tickets-billet-meta {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.88;
  margin-bottom: 0.45rem;
}

.tickets-main-card .tickets-image-box {
  padding: 0;
  line-height: 0;
  text-align: center;
  background: transparent;
}

.tickets-image-box {
  margin: 0;
}

.tickets-image-box img {
  max-width: 100%;
  max-height: 620px;
  width: auto;
  height: auto;
  display: block;
  margin: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  border-radius: 0;
}

/* Divider + answer area (same bg as card) */
.tickets-main-card .tickets-answers-grid {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  margin: 0;
  padding: 0.5rem 0.6rem 0.75rem;
  gap: 4px;
}

.tickets-answers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  font-size: 16px;
}

.tickets-answer-cell {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0.75rem 0.85rem;
  color: #fff;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 3rem;
  pointer-events: none;
  user-select: text;
  border-radius: 2px;
}

.tickets-answer-cell .tickets-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  background: #fff;
  color: #111;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.tickets-answer-cell .tickets-answer-txt {
  flex: 1;
  line-height: 1.4;
  font-size: 15px;
  font-weight: 500;
}

.tickets-answer-cell.tickets-cell-correct {
  background: rgba(5, 160, 40, 0.35);
  border-color: rgba(120, 220, 140, 0.7);
}

.tickets-answer-cell.tickets-cell-wrong {
  background: rgba(200, 35, 45, 0.35);
  border-color: rgba(255, 160, 170, 0.55);
}

/* Number pickers — outside the dark card, on page background */
.tickets-num-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 0.25rem;
  padding: 0.35rem 0 0.5rem;
}

.tickets-num-btn {
  min-width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: inherit;
  color: #111;
  background: #f0f2f4;
  border: 1px solid #2a3f4d;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.tickets-num-btn:hover:not(:disabled) {
  background: #e8eaed;
  border-color: #1a3a44;
}

.tickets-num-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: #ddd;
  color: #555;
  border-color: #aaa;
}

.tickets-num-btn.tickets-num-picked {
  border-color: #173456;
  background: #dce8f0;
  box-shadow: 0 0 0 2px rgba(23, 52, 86, 0.2);
}

@media (max-width: 768px) {
  .tickets-bloc.container.py-4 {
    padding-left: 0;
    padding-right: 0;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .tickets-main-card {
    overflow: visible;
  }

  .tickets-explained-btn {
    right: 8px;
    top: 8px;
    width: 38px;
    height: 38px;
    font-size: 22px;
    z-index: 50;
  }

  .tickets-question-overlay {
    padding-right: 3.25rem;
  }
}

@media (max-width: 500px) {
  .tickets-answers-grid {
    grid-template-columns: 1fr;
  }
  .tickets-answer-cell,
  .tickets-answer-cell .tickets-answer-txt {
    font-size: 14px;
  }
}
