/* ===== TABLEAU DES QUÊTES SECONDAIRES ===== */

/* ── Hero (vidéo partagée avec le reste du site) ── */
.quete-hero {
  position: relative;
  max-width: none;
  margin: 0;
  padding: 6rem 2rem 2.5rem;
  text-align: center;
  background: #160401;
  overflow: hidden;
  min-height: 40vh;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px) brightness(0.90) saturate(0.9);
}

.hero-video-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, #160401, transparent);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.quete-title {
  font-family: var(--font-title);
  font-size: 2.6rem;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.quete-subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.1rem;
  color: #c9b89a;
  letter-spacing: 0.5px;
  margin-bottom: 1.8rem;
}

.quete-intro {
  max-width: 680px;
  margin: 0 auto;
}

.quete-intro p {
  font-family: var(--font-body);
  font-size: 1rem;
  color: #d8c8a8;
  line-height: 1.7;
}

/* ── Onglets ── */
.quete-tabs {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 1.6rem 1rem;
  background: #120000;
  border-bottom: 1px solid rgba(167, 138, 127, 0.2);
}

.quete-tab {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: #c9b89a;
  background: transparent;
  border: 1px solid rgba(167, 138, 127, 0.35);
  border-radius: 999px;
  padding: 0.55rem 1.3rem;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}

.quete-tab:hover {
  border-color: var(--gold);
  color: var(--parchment);
}

.quete-tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #160401;
  font-weight: 600;
}

/* ── Corps principal ── */
.quete-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.6rem 1.5rem 4rem;
  min-height: 50vh;
}

.quete-view {
  display: none;
}

.quete-view.active {
  display: block;
  animation: quete-fade-in 0.4s ease;
}

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

.quete-view-eyebrow {
  text-align: center;
  font-family: var(--font-accent);
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.5px;
  margin-top: 1.6rem;
  margin-bottom: 1.6rem;
}

.quete-tirer-illus {
  display: block;
  width: 128px;
  height: 128px;
  margin: 0 auto 0.8rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

/* ── Formulaire de filtres ── */
.quete-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.4rem;
  max-width: 460px;
  margin: 0 auto 1.8rem;
}

.quete-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.quete-field label {
  font-family: var(--font-accent);
  font-size: 0.85rem;
  color: var(--gold-dim);
  letter-spacing: 0.5px;
}

.quete-field select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--wood-light);
  border-radius: 6px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b4226'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
}

.quete-field select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

/* ── Boutons d'action ── */
.quete-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  max-width: 460px;
  margin: 0 auto 2.2rem;
  text-align: center;
}

.quete-or {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--gold-dim);
}

.btn-quete {
  font-family: var(--font-accent);
  font-size: 1rem;
  letter-spacing: 0.4px;
  color: var(--parchment);
  background: linear-gradient(160deg, var(--wood-light), var(--wood-dark));
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 0.75rem 1.6rem;
  min-width: 260px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-quete:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--mist);
  border-color: var(--gold);
}

.btn-quete:active {
  transform: translateY(0);
}

.btn-surprise {
  background: linear-gradient(160deg, #5a3a4a, #370617);
}

/* ── Carte de quête ── */
.quete-card-slot {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 60px;
}

.quete-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 373px;
  width: 100%;
  margin: 0 auto;
  background: var(--parchment) url('../img/carnet-fiche.png') center / cover no-repeat;
  background-blend-mode: multiply;
  border: 1px solid var(--wood-light);
  border-radius: 6px;
  padding: 2.4rem 1.7rem 1.8rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  animation: quete-fade-in 0.4s ease;
}

/* ── Raretés (dérivées de la difficulté + du temps) ── */

.quete-card.rarity-rare,
.carnet-entry.rarity-rare {
  border-color: #4d6f99;
  --rarity-glow: 77, 111, 153;
  animation: quete-fade-in 0.4s ease, rarity-pulse-soft 3s ease-in-out infinite;
}

.quete-card.rarity-epique,
.carnet-entry.rarity-epique {
  border-color: #7a4d99;
  --rarity-glow: 122, 77, 153;
  animation: quete-fade-in 0.4s ease, rarity-pulse 2.4s ease-in-out infinite;
}

.quete-card.rarity-legendaire,
.carnet-entry.rarity-legendaire {
  border-color: #e0721a;
  --rarity-glow: 224, 114, 26;
  animation: quete-fade-in 0.4s ease, rarity-pulse-strong 1.7s ease-in-out infinite;
}

@keyframes rarity-pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--rarity-glow), 0.3), 0 6px 24px rgba(0, 0, 0, 0.35); }
  50%      { box-shadow: 0 0 10px 2px rgba(var(--rarity-glow), 0.35), 0 6px 24px rgba(0, 0, 0, 0.35); }
}

@keyframes rarity-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--rarity-glow), 0.45), 0 6px 24px rgba(0, 0, 0, 0.35); }
  50%      { box-shadow: 0 0 16px 3px rgba(var(--rarity-glow), 0.55), 0 6px 24px rgba(0, 0, 0, 0.35); }
}

@keyframes rarity-pulse-strong {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--rarity-glow), 0.55), 0 6px 24px rgba(0, 0, 0, 0.35); }
  50%      { box-shadow: 0 0 28px 6px rgba(var(--rarity-glow), 0.8), 0 6px 24px rgba(0, 0, 0, 0.35); }
}

.quete-rarity {
  font-family: var(--font-accent);
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.quete-rarity-commune    { color: #8a8a8a; }
.quete-rarity-rare       { color: #4d6f99; }
.quete-rarity-epique     { color: #7a4d99; }
.quete-rarity-legendaire { color: #e0721a; }

.quete-card-eyebrow {
  font-family: var(--font-accent);
  font-size: 0.85rem;
  color: var(--sepia);
  text-align: center;
  letter-spacing: 1px;
  margin-bottom: 0.6rem;
}

.quete-card-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--ink);
  text-align: center;
  margin-bottom: 1.2rem;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.quete-tags {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.quete-tag {
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--parchment-dk);
  border: 1px solid var(--sepia);
  color: var(--ink-soft);
  white-space: nowrap;
}

.quete-tag-temps    { border-color: var(--green-moss); }
.quete-tag-budget   { border-color: var(--gold-dim); }
.quete-tag-humeur   { border-color: var(--wood-light); }
.quete-tag-difficulte { border-color: var(--wax); }

.quete-card-desc {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.98rem;
  letter-spacing: 0.4px;
  line-height: 1.8;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 1.6rem;
}

.quete-card-actions {
  display: flex;
  justify-content: center;
  margin-top: auto;
}

.btn-add-journal {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--parchment);
  background: var(--green-dark);
  border: 1px solid var(--green-moss);
  border-radius: 6px;
  padding: 0.55rem 1.3rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-add-journal:hover {
  background: var(--green-moss);
}

.btn-add-journal[disabled] {
  background: var(--sepia);
  border-color: var(--sepia);
  cursor: default;
  opacity: 0.7;
}

/* ── Carnet ── */

.carnet-header-card {
  max-width: 480px;
  margin: 1.6rem auto;
  padding: 1.1rem 1.4rem;
  text-align: center;
  background: linear-gradient(160deg, rgba(201, 168, 76, 0.1), rgba(63, 4, 24, 0.25));
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 10px;
  animation: quete-fade-in 0.4s ease;
}

.quete-profil-irl {
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

.quete-profil-irl-eyebrow {
  font-family: var(--font-accent);
  font-size: 0.72rem;
  color: var(--gold-dim);
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.quete-profil-irl-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.quete-profil-irl-placeholder {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.85rem;
  color: #a78a7f;
}

.quete-auth-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
}

.quete-auth-twitch-icon {
  width: 15px;
  height: 15px;
  color: #9146ff;
  vertical-align: -2px;
}

.quete-icon-inline {
  vertical-align: -2px;
  flex-shrink: 0;
}

.quete-auth-inline-text {
  color: #a78a7f;
}

.quete-auth-inline-link {
  color: #8a9e7a;
  text-decoration: none;
  border-bottom: 1px dashed rgba(138, 158, 122, 0.5);
  transition: color 0.2s ease;
}

.quete-auth-inline-link:hover {
  color: #b8cca8;
}

.quete-auth-inline-link--login {
  color: #a78a7f;
  border-bottom-color: rgba(167, 138, 127, 0.4);
}

.quete-auth-inline-link--login:hover {
  color: #e7d7c1;
}

.quete-auth-inline-hint {
  flex-basis: 100%;
  margin: 0.2rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #8a7568;
}

.carnet-progress-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 1.7rem;
  padding: 0.25rem 0;
  background: rgba(107, 66, 38, 0.25);
  border: 1px solid var(--wood-light);
  border-radius: 999px;
}

.carnet-progress-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-moss), var(--green-dark));
  transition: width 0.4s ease;
}

.carnet-progress-bar.is-complete .carnet-progress-fill {
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
}

.carnet-progress-label {
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--cream);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  padding: 0 0.8rem;
}

.carnet-sync-status {
  text-align: center;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--green-moss);
  margin: 0 auto 1rem;
  max-width: 480px;
  animation: quete-fade-in 0.4s ease;
}

.carnet-list {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 1.4rem;
  justify-content: center;
}

.carnet-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 260px;
  background: var(--parchment) url('../img/carnet-fiche.png') center / cover no-repeat;
  background-blend-mode: multiply;
  border: 1px solid var(--wood-light);
  border-radius: 6px;
  padding: 1.3rem 1.3rem 1.1rem;
  overflow: hidden;
}

.carnet-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.carnet-entry > * {
  position: relative;
  z-index: 1;
}

.carnet-entry.is-done:not([class*="rarity-rare"]):not([class*="rarity-epique"]):not([class*="rarity-legendaire"]) {
  border-color: var(--green-moss);
}

.carnet-entry.is-done::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(107, 124, 94, 0.22);
  pointer-events: none;
  z-index: 0;
}

.carnet-check {
  appearance: none;
  -webkit-appearance: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--green-moss);
  background: var(--parchment);
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.carnet-check::before {
  content: '';
  width: 0.7rem;
  height: 0.55rem;
  clip-path: polygon(14% 44%, 0 65%, 45% 100%, 100% 16%, 82% 0%, 43% 68%);
  background: var(--cream);
  transform: scale(0);
  transition: transform 0.15s ease-in-out;
}

.carnet-check:checked {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.carnet-check:checked::before {
  transform: scale(1);
}

.carnet-entry-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.carnet-entry-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: var(--ink);
  text-align: center;
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.carnet-entry.is-done .carnet-entry-title {
  text-decoration: line-through;
  color: var(--green-dark);
}

.carnet-entry-tags {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.carnet-entry-tags .quete-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
}

.carnet-entry-desc {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}

.carnet-note-label {
  display: block;
  font-family: var(--font-accent);
  font-size: 0.75rem;
  color: var(--sepia);
  letter-spacing: 0.4px;
  margin-bottom: 0.25rem;
}

.carnet-note-status {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--green-dark);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.carnet-note-status.visible {
  opacity: 1;
}

.carnet-note-input {
  width: 100%;
  min-height: 2.4rem;
  resize: vertical;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.35);
  border: none;
  border-bottom: 1px dashed var(--sepia);
  border-radius: 2px;
  padding: 0.3rem 0.4rem;
}

.carnet-note-input:focus {
  outline: none;
  border-bottom-color: var(--wax);
  background: rgba(255, 255, 255, 0.55);
}

.carnet-note-input::placeholder {
  color: var(--gold-dim);
  opacity: 0.8;
}

.carnet-remove {
  background: none;
  border: none;
  color: var(--wax);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  flex-shrink: 0;
}

.carnet-remove:hover {
  opacity: 0.7;
}

.carnet-empty {
  display: none;
  text-align: center;
  padding: 2.5rem 1rem;
}

.carnet-empty.visible {
  display: block;
}

.carnet-empty p {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--gold-dim);
  margin-bottom: 1.2rem;
}

/* ── Zorbin (bulle de dialogue, style repris des Archives) ── */
.zorbin-quip-slot {
  max-width: 373px;
  margin: 0.8rem auto 0;
}

/* Variante flottante : superposée à l'angle de la carte de quête, pour ne jamais
   passer inaperçue même sans scroller. */
.quete-jour-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 373px));
  grid-template-rows: auto auto;
  grid-auto-flow: column;
  justify-content: center;
  gap: 2.6rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

/* Dans la grille du jour, le wrap "disparaît" pour que la carte et la bulle Zorbin
   deviennent chacune leur propre ligne de grille (ligne 1 = cartes, ligne 2 = bulles) —
   comme ça une bulle plus longue ne "vole" plus de hauteur à la carte d'à côté. */
.quete-jour-grid .quete-card-wrap {
  display: contents;
}

.quete-card-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 373px;
  width: 100%;
  margin: 0 auto;
}

.zorbin-quip-float {
  position: absolute;
  top: -0.9rem;
  right: -13.2rem;
  width: 210px;
  z-index: 5;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.zorbin-quip-float:empty {
  display: none;
}

@media (max-width: 640px) {
  .zorbin-quip-float {
    position: static;
    width: auto;
    margin-top: 0.6rem;
    filter: none;
  }
}

.zorbin-dialogue {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  animation: quete-fade-in 0.4s ease;
}

.zorbin-dialogue-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.zorbin-dialogue-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(201, 168, 76, 0.35);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.15);
  object-fit: cover;
}

.zorbin-dialogue-name {
  font-family: var(--font-title);
  font-size: 0.6rem;
  color: #c9a84c;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.zorbin-dialogue-bubble {
  position: relative;
  background: rgba(63, 4, 24, 0.4);
  border: 1px solid rgba(167, 138, 127, 0.2);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  flex: 1;
  min-width: 0;
}

.zorbin-dialogue-arrow {
  position: absolute;
  left: -7px;
  top: 16px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 7px solid rgba(167, 138, 127, 0.2);
}

.zorbin-dialogue-arrow::after {
  content: '';
  position: absolute;
  left: 2px;
  top: -5px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid rgba(63, 4, 24, 0.4);
}

.zorbin-dialogue-text {
  font-size: 0.8rem;
  color: #e7d7c1;
  font-style: italic;
  line-height: 1.5;
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  /* Deux fiches cote a cote deviennent illisibles sous 860px : on empile */
  .quete-jour-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-auto-flow: row;
    gap: 1.6rem;
    max-width: 420px;
  }
}

@media (max-width: 640px) {
  .quete-title {
    font-size: 2rem;
  }

  .quete-card {
    padding: 1.6rem 1.3rem;
  }

  .quete-card-title {
    font-size: 1.35rem;
  }

  .quete-tabs {
    gap: 0.5rem;
    padding: 1.1rem 0.6rem;
  }

  .quete-tab {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }

  .btn-quete {
    min-width: 0;
    width: 100%;
    max-width: 320px;
  }

  .quete-main {
    padding: 1.8rem 0.9rem 3rem;
  }

  .quete-tirer-illus {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 420px) {
  .quete-form {
    grid-template-columns: 1fr;
  }
}
