/* ---------------------------------------------------------------- carnet du chroniqueur : un livre de parchemin */
.carnet-screen { padding: 3vh 3vw; }
.carnet {
  --pa: #efe0bc; --pa2: #e2cc9c; --inkb: #3a2814; --inkm: #6a5434; --red: #8a2418;
  display: flex; width: min(1180px, 94vw); height: min(780px, 90vh); border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 0 2px #2a1a0a, 0 0 0 7px #5a3818, 0 0 0 9px #241406;
  animation: cnOpen 0.45s ease-out;
}
@keyframes cnOpen { from { transform: perspective(1400px) rotateY(-8deg) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
.cn-left, .cn-right {
  position: relative; color: var(--inkb);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 250, 230, 0.55), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(150, 100, 40, 0.18), transparent 55%),
    repeating-linear-gradient(0deg, rgba(120, 80, 30, 0.035) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, var(--pa), var(--pa2));
}
.cn-left { width: 300px; flex: none; padding: 26px 22px 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: inset -18px 0 26px -16px rgba(80, 50, 10, 0.55); }
.cn-right { flex: 1; display: flex; flex-direction: column; min-width: 0; box-shadow: inset 18px 0 26px -16px rgba(80, 50, 10, 0.55); }
.cn-book { font-family: var(--deco); font-size: 27px; line-height: 1.1; color: #4a2a0c; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
.cn-sub { font-family: var(--title); font-size: 13px; color: var(--inkm); letter-spacing: 0.5px; }
.cn-count { font-family: var(--title); font-size: 15px; color: var(--inkm); }
.cn-count b { font-size: 22px; color: #4a2a0c; }
.cn-bar { height: 6px; margin-top: 5px; border-radius: 4px; background: rgba(90, 60, 20, 0.18); overflow: hidden; }
.cn-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8a5a1c, #c8902c); }
.cn-chaps { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.cn-chaps button {
  position: relative; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid transparent; border-radius: 6px;
  background: none; color: var(--inkb); font-family: var(--title); font-size: 15px; text-align: left; cursor: pointer;
}
.cn-chaps button:hover { background: rgba(120, 80, 30, 0.1); }
.cn-chaps button.on { background: rgba(120, 80, 30, 0.16); border-color: rgba(90, 60, 20, 0.35); }
.cc-i { font-size: 18px; width: 22px; text-align: center; }
.cc-l { flex: 1; }
.cc-n { font-family: var(--ui); font-size: 13px; color: var(--inkm); }
.cn-help { margin-top: auto; font-style: italic; font-size: 13px; line-height: 1.4; color: var(--inkm); }
.cn-left .mbtn { text-align: center; }
.cn-head { padding: 22px 30px 10px; font-family: var(--deco); font-size: 24px; color: #4a2a0c; border-bottom: 1px solid rgba(90, 60, 20, 0.25); margin: 0 24px; }
.cn-head span { font-size: 22px; margin-right: 6px; }
.cn-pages { flex: 1; overflow-y: auto; padding: 16px 26px 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-content: start; }
.cn-pages::-webkit-scrollbar { width: 9px; }
.cn-pages::-webkit-scrollbar-thumb { background: rgba(90, 60, 20, 0.35); border-radius: 6px; }
.cn-page {
  position: relative; display: flex; gap: 14px; padding: 13px 14px; border-radius: 8px; min-height: 118px;
  background: rgba(255, 250, 235, 0.42); border: 1px solid rgba(90, 60, 20, 0.22); box-shadow: 0 2px 6px rgba(80, 50, 10, 0.12);
}
.cn-page.fresh { border-color: rgba(138, 36, 24, 0.55); box-shadow: 0 0 0 1px rgba(138, 36, 24, 0.25), 0 3px 12px rgba(138, 36, 24, 0.2); }
.cn-body { min-width: 0; }
.cn-title { font-family: var(--title); font-weight: 700; font-size: 17px; color: #3a1e08; margin-bottom: 5px; }
.cn-text { font-size: 14.5px; line-height: 1.42; color: var(--inkb); }
.cn-page.locked { background: rgba(255, 250, 235, 0.18); border-style: dashed; }
.cn-page.locked .cn-title { color: rgba(58, 30, 8, 0.45); letter-spacing: 3px; }
.cn-teaser { font-style: italic; font-size: 14.5px; line-height: 1.42; color: var(--inkm); }
.cn-clues { display: block; margin-top: 7px; font-style: normal; font-size: 13.5px; color: var(--red); }
/* illustration : medaillon d'encre ; en silhouette (encre plate) tant que la page est blanche */
.cn-art {
  flex: none; width: 86px; height: 86px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 40% 35%, #fbf2da, #d8c090); box-shadow: inset 0 0 0 2px rgba(70, 40, 10, 0.55), inset 0 0 14px rgba(90, 60, 20, 0.35), 0 2px 5px rgba(60, 30, 5, 0.3);
}
.cn-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cn-art.wide { width: 120px; border-radius: 10px; }
.cn-art .cn-emo { font-size: 42px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(60, 30, 5, 0.35)); }
.cn-art.locked .cn-emo { filter: brightness(0) opacity(0.32); }
/* image peinte inconnue : un dessin efface, a peine devine */
.cn-art.locked img { filter: grayscale(1) sepia(1) contrast(1.5) brightness(0.72) blur(1.8px) opacity(0.5); transform: scale(1.06); }
.cn-art.locked { background: radial-gradient(circle at 40% 35%, #f3e6c6, #d6c094); }
.cn-page.secret .cn-art.locked { box-shadow: inset 0 0 0 2px rgba(138, 36, 24, 0.55), inset 0 0 14px rgba(138, 36, 24, 0.3); }
.cn-art.sm { width: 46px; height: 46px; }
.cn-art.sm.wide { width: 62px; border-radius: 7px; }
.cn-art.sm .cn-emo { font-size: 24px; }
/* sceau de cire « Nouveau » */
.cn-seal {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: radial-gradient(circle at 35% 30%, #c8402c, #7a1a10); color: #ffe8d0; font-family: var(--ui); font-size: 12px; font-weight: 700;
  box-shadow: 0 1px 3px rgba(60, 10, 5, 0.5), inset 0 0 0 1px rgba(255, 200, 170, 0.3);
}
.cn-seal.big { position: absolute; top: -8px; right: -6px; transform: rotate(8deg); font-family: var(--title); padding: 0 9px; height: 24px; }
.cn-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 8px; padding: 0 6px; border-radius: 10px; background: #a8301e; color: #fff0e0; font-family: var(--ui); font-size: 12px; font-weight: 700; vertical-align: 2px; }
.mbtn .mi + .cn-badge { margin-left: 8px; }

/* ---------------------------------------------------------------- en jeu : petits parchemins a droite */
.chron {
  display: flex; gap: 11px; align-items: center; min-width: 300px; max-width: 400px; padding: 9px 14px 9px 9px; border-radius: 8px;
  color: #3a2814; background: linear-gradient(180deg, #f1e3c2, #ddc597); border: 1px solid #8a6a34;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55); animation: slideIn 0.4s; transition: opacity 0.7s;
}
.chron.out { opacity: 0; }
.chron .ct-k { font-family: var(--title); font-size: 12.5px; color: #7a4a14; letter-spacing: 0.5px; }
.chron .ct-t { font-family: var(--title); font-weight: 700; font-size: 16px; color: #3a1e08; }
.chron .ct-x { font-size: 14px; line-height: 1.38; color: #3a2814; }
.chron.ins { align-items: flex-start; max-width: 430px; border-color: #8a2418; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(138, 36, 24, 0.3); }
.chron .ins-i { font-size: 34px; line-height: 1; padding-top: 3px; }
.chron .ins-t { font-family: var(--title); font-weight: 700; font-size: 16px; color: #3a1e08; margin-bottom: 4px; }
.chron .ins-x { font-size: 14.5px; line-height: 1.42; font-style: italic; }
.chron .ins-x b { font-style: normal; color: #8a2418; }
.chron .ins-f { margin-top: 6px; font-size: 12px; color: #7a5a2a; }

/* ---------------------------------------------------------------- le vieux conteur */
#conteur {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%); width: min(600px, 82vw); z-index: 29;
  display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px 12px 12px; border-radius: 12px;
  color: #3a2814; background: linear-gradient(180deg, rgba(243, 230, 198, 0.97), rgba(222, 200, 152, 0.97)); border: 2px solid #7a5426;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.6);
}
#conteur.hidden { display: none; }
#conteur.pop { animation: tuPop 0.35s ease-out; }
#conteur .ct-por { flex: none; width: 74px; height: 74px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 40% 35%, #fbf2da, #c8aa70); box-shadow: inset 0 0 0 2px #6a4418, 0 2px 6px rgba(60, 30, 5, 0.4); }
#conteur .ct-por img { width: 100%; height: 100%; object-fit: cover; }
#conteur .ct-main { flex: 1; min-width: 0; }
#conteur .ct-who { font-family: var(--title); font-size: 13px; color: #7a4a14; letter-spacing: 1px; text-transform: uppercase; }
#conteur .ct-q { font-family: var(--title); font-size: 16.5px; line-height: 1.45; color: #2e1c08; margin: 3px 0 2px; }
#conteur .ct-note { font-size: 13.5px; color: #5a4020; margin-top: 4px; }
#conteur .ct-b { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
#conteur .sbtn { color: #5a3a14; border-color: rgba(90, 60, 20, 0.4); background: rgba(255, 250, 230, 0.4); }
body.ui-paused #conteur { display: none !important; }

/* ---------------------------------------------------------------- pastilles « Nouveau ! » */
.cbtn.is-new { position: relative; }
.cbtn.is-new::after {
  content: attr(data-new); position: absolute; top: -7px; right: -6px; z-index: 2; pointer-events: none;
  padding: 1px 6px; border-radius: 8px; transform: rotate(6deg);
  background: radial-gradient(circle at 35% 30%, #e8503a, #9a2416); color: #fff3e0; font-family: var(--ui); font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); animation: newPulse 1.8s ease-in-out infinite;
}
@keyframes newPulse { 0%, 100% { transform: rotate(6deg) scale(1); } 50% { transform: rotate(6deg) scale(1.12); } }
.wtip.new { background: linear-gradient(180deg, rgba(243, 230, 198, 0.95), rgba(214, 190, 140, 0.95)); color: #3a2010; border-color: #8a2418; }

/* ---------------------------------------------------------------- ecran de chargement : conseil du chroniqueur */
#load-tip { max-width: 620px; min-height: 44px; text-align: center; font-style: italic; color: var(--gold2); font-size: 16px; line-height: 1.45; opacity: 0.92; }
#load-tip span { display: block; font-style: normal; font-family: var(--title); font-size: 12.5px; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 3px; text-transform: uppercase; }
.mbtn[data-a="carnet"] { letter-spacing: 0; white-space: nowrap; font-size: 16.5px; }
.tab.has-new { position: relative; }
.tab.has-new::after { content: ""; position: absolute; top: 4px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f06048, #9a2416); box-shadow: 0 0 6px rgba(240, 96, 72, 0.8); }
