/* ─── Reset & base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Flash de transition entre écrans ── */
#flash-overlay {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
}
#flash-overlay.visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  #flash-overlay { display: none; }
}

:root {
  --black:       #111111;
  --white:       #ffffff;
  --off-white:   #f5f3ee;
  --red:         #fe4445;
  --red-dark:    #b0001a;
  --yellow:      #fcf58b;
  --grey:        #888888;
  --grey-light:  #e0ddd8;
  --grey-mid:    #cccccc;
  --chat-bg:     #e0ddd8;
  --text:        #111111;
  --text-muted:  #555555;
  --grey-dark:   #111111;
  --green:       #4dd066;
  --transition:  .2s ease;
}

html { scroll-behavior: smooth; font-size: 120%; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--chat-bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ─── Screens ─── */
.screen { display: none; flex-direction: column; flex: 1; }
.screen.active { display: flex; }

/* ════════════════════════════════════════════
   WELCOME SCREEN
════════════════════════════════════════════ */
#screen-welcome {
  align-items: center;
  background: var(--yellow);
  padding: 40px 16px;
  min-height: 100vh;
  overflow-y: auto;
  animation: fadeIn .3s ease;
}
#screen-welcome > .welcome-box { margin: auto 0; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.welcome-box {
  max-width: 640px;
  width: 100%;
  text-align: center;
  color: var(--grey-dark);
}

.welcome-box .logo { width: 400px; max-width: 100%; margin-bottom: 2rem; }

.welcome-box h1,
.welcome-box h2 {
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  font-size: 3rem;
  line-height: 1.05;
  margin-bottom: 8px;
  letter-spacing: -.01em;
}

.welcome-box .tagline {
  font-size: .82rem;
  margin-bottom: 24px;
  line-height: 1.6;
  color: var(--red-dark);
  letter-spacing: .1em;
}

.welcome-card {
  background: var(--off-white);
  border: 3px solid var(--red);
  padding: 20px 24px;
  margin-bottom: 20px;
  text-align: left;
  color: var(--black);
}

.welcome-card h3 {
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.09rem;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--grey-dark);
  letter-spacing: .08em;
}

.welcome-card p { font-size: .9rem; line-height: 1.65; opacity: .95; margin: .8rem 0; color: var(--black); }

.welcome-card.avatar-card { display: flex; gap: 16px; align-items: flex-start; }
.wc-avatar { font-size: 2.8rem; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.wc-content { flex: 1; }

.indicators-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.indicator-chip {
  flex: 1;
  min-width: 100px;
  background: var(--black);
  padding: 10px 12px;
  text-align: center;
  color: var(--white);
}

.indicator-chip .chip-icon { font-size: 1.4rem; display: block; margin-bottom: 4px; }
.indicator-chip .chip-name { font-size: .9rem; color: var(--white); letter-spacing: .04em; }
.indicator-chip .chip-val  {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--yellow);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: 2px solid var(--red-dark);
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 4px 4px 0 var(--red-dark);
  text-decoration: none;
}

.btn:hover  { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--red-dark); }
.btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--red-dark); }
.btn-primary { background: var(--red); color: var(--white); }

/* ── Options d'accueil ── */
.welcome-options {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.welcome-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.welcome-toggle input { display: none; }

.wt-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--grey);
  background: transparent;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
  position: relative;
}

.welcome-toggle input:checked + .wt-box {
  background: var(--yellow);
  border-color: var(--yellow);
}

.welcome-toggle input:checked + .wt-box::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 6px;
  height: 11px;
  border: 2px solid var(--black);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.wt-label {
  font-size: .82rem;
  color: var(--grey-dark);
  letter-spacing: .05em;
}

/* ════════════════════════════════════════════
   CHAT HEADER
════════════════════════════════════════════ */
.chat-header {
  background: var(--black);
  color: var(--white);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 3px solid var(--red);
}

.chat-header-row1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.chat-avatar-emoji {
  font-size: 1.7rem;
  line-height: 36px;
  display: block;
  text-align: center;
}

.chat-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--black);
  transition: background .4s;
}

.chat-online-dot.offline { background: var(--red); }

.chat-header-info { flex: 1; min-width: 0; }

.chat-header-name {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .9rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .04em;
}

.chat-header-role { font-size: .9rem; color: var(--grey); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Encadré tour législatif */
.chp-tour-pill {
  min-width: 0;
  height: 54px;
  display: flex;
  align-items: stretch;
  gap: 4px;
  background: transparent;
  border: 2px solid rgba(255,255,255,.18);
  padding: 4px 7px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  overflow: hidden;
  transition: border-color .15s;
}
.chp-tour-pill:hover { border-color: var(--yellow); }

.chp-tour-num {
  color: var(--grey);
  white-space: nowrap;
  font-size: .55rem;
  letter-spacing: .04em;
}

.chp-tour-name {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .72rem;
  font-weight: 900;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 14rem;
}

.chp-bar-bg {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,.12);
  margin-top: 2px;
  overflow: hidden;
}

.chp-bar {
  height: 100%;
  background: var(--yellow);
  width: 0%;
  transition: width .5s ease;
}

/* ── Overlay notification ── */
.notif-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 1999;
}
body.notif-open .notif-overlay { display: block; }

/* ── Calendrier overlay ── */
.cal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cal-overlay.open { display: flex; }

.cal-modal {
  position: relative;
  background: var(--white);
  color: var(--black);
  border: 3px solid var(--black);
  box-shadow: 6px 6px 0 var(--black);
  width: 100%;
  max-width: 360px;
  max-height: 90vh;
  overflow-y: auto;
}

.cal-modal .pn-header {
  background: var(--black);
  color: var(--white);
  padding: 14px 16px 12px;
  margin-bottom: 0;
  border-bottom: none;
}

.cal-inner { padding: 14px 16px 10px; }

.cal-footer {
  padding: 10px 16px 16px;
  display: flex;
  justify-content: flex-end;
}

.cal-ok-btn { padding: 8px 28px; font-size: .9rem; }

.cal-month-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.cal-month-title {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-size: .95rem;
  letter-spacing: .05em;
}

.cal-nav-btn {
  background: none;
  border: 2px solid var(--grey-light);
  color: var(--black);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 10px;
  line-height: 1;
  transition: background .12s, border-color .12s;
}
.cal-nav-btn:hover { background: var(--yellow); border-color: var(--black); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 14px;
}

.cal-day-head {
  font-size: .6rem;
  color: var(--grey);
  text-align: center;
  padding: 2px 0 4px;
  font-weight: 700;
  letter-spacing: .03em;
}

.cal-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: var(--grey);
}

.cal-cell.has-tour {
  color: var(--black);
  cursor: pointer;
  font-weight: 700;
  border: 1px solid transparent;
}
.cal-cell.has-tour:hover { border-color: var(--black); background: var(--off-white); }
.cal-cell.selected { background: var(--black); color: var(--white); font-weight: 700; }
.cal-cell.selected:hover { background: var(--black); }

.cal-dot {
  display: block;
  width: 4px;
  height: 4px;
  background: var(--red);
  opacity: .8;
  margin-top: 1px;
}
.cal-cell.selected .cal-dot { background: var(--yellow); opacity: 1; }

.cal-desc-panel {
  border-top: 2px solid var(--black);
  padding-top: 14px;
}

.cal-desc-label {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-size: .9rem;
  margin-bottom: 4px;
  line-height: 1.3;
}

.cal-desc-date { font-size: .72rem; color: var(--red); margin-bottom: 8px; text-transform: capitalize; font-weight: 700; }
.cal-desc-text { font-size: .8rem; color: var(--text-muted); line-height: 1.55; }
.cal-desc-empty { font-size: .8rem; color: var(--grey); text-align: center; padding: 12px 0; }

/* Ligne 2 : indicateurs */
.chat-header-scores {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 5px;
}

.score-pill {
  min-width: 0;
  height: 54px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  gap: 4px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16);
  padding: 4px 7px;
  transition: border-color .3s;
}

.score-pill.danger  { border-color: var(--red); background: rgba(232,0,28,.2); }
.score-pill.warning { border-color: var(--yellow); background: rgba(255,230,0,.1); }

.sp-icon    { font-size: .95rem; flex-shrink: 0; line-height: 1; align-self: flex-start; margin-top: 0.5rem; }
.sp-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.chp-tour-pill .sp-icon { margin-top: 0.7rem; }

.sp-label {
  font-size: .55rem;
  letter-spacing: .06em;
  color: var(--grey);
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
}

.sp-val {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  transition: color .5s;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-bar-bg {
  height: 3px;
  background: rgba(255,255,255,.12);
  margin-top: 2px;
  overflow: hidden;
}

.sp-bar {
  height: 100%;
  background: var(--yellow);
  transition: width .5s ease, background .3s;
  width: 40%;
}

.sp-bar.danger  { background: var(--red); }
.sp-bar.warning { background: var(--yellow); }

/* ════════════════════════════════════════════
   CHAT MESSAGES
════════════════════════════════════════════ */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--chat-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4c9b8' fill-opacity='0.3'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ─── Séparateur de date ─── */
.chat-date-sep {
  align-self: center;
  font-size: .68rem;
  color: var(--text-muted);
  background: var(--grey-light);
  border: 1px solid var(--grey-mid);
  padding: 3px 10px;
  margin: 6px 0;
  pointer-events: none;
  user-select: none;
  letter-spacing: .05em;
  font-weight: 700;
}

/* ─── Message rows ─── */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  max-width: min(88%, 700px);
  animation: msgIn .18s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-row.naomi  { align-self: flex-start; }
.msg-row.player { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar { font-size: 1.5rem; line-height: 1; flex-shrink: 0; margin-bottom: 2px; }
.msg-row.player .msg-avatar { display: none; }

/* ─── Bubbles ─── */
.msg-bubble {
  background: var(--black);
  color: var(--white);
  padding: 10px 13px;
  font-size: .91rem;
  line-height: 1.55;
  max-width: 100%;
  word-break: break-word;
  box-shadow: 0px 0px 10px rgb(0 0 0 / 20%);
}

.msg-row.player .msg-bubble {
  background: var(--yellow);
  color: var(--black);
  font-weight: 600;
}

.msg-bubble .msg-time {
  font-size: .62rem;
  color: rgba(255,255,255,.4);
  text-align: right;
  margin-top: 4px;
  display: block;
}

.msg-row.player .msg-bubble .msg-time { color: rgba(0,0,0,.4); }

.msg-sender {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .65rem;
  font-weight: 900;
  color: var(--yellow);
  margin-bottom: 3px;
  letter-spacing: .06em;
}

/* ─── Typing indicator ─── */
.typing-bubble {
  background: var(--black);
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: none;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--grey);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(1); opacity: .5; }
  40%           { transform: scale(1.3); opacity: 1; }
}

/* ─── Delta chips ─── */
.delta-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.delta-chip {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .77rem;
  font-weight: 900;
  padding: 3px 9px;
}
.delta-chip.pos  { background: #d4f0dc; color: #1a5c2a; border: 1px solid #1a5c2a; }
.delta-chip.neg  { background: #fce8e8; color: var(--red); border: 1px solid var(--red); }
.delta-chip.zero { background: var(--grey-light); color: var(--text-muted); border: 1px solid var(--grey-mid); }

/* ─── Option cards ─── */
.options-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

.option-card {
  background: var(--off-white);
  border: 2px solid var(--grey-light);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-size: .87rem;
}

.option-card:hover:not(.done) { border-color: var(--black); box-shadow: 2px 2px 0 var(--black); background: var(--white); }
.option-card.selected         { border-color: var(--black); box-shadow: 3px 3px 0 var(--black); background: var(--white); }

.option-card.done { opacity: .5; cursor: default; pointer-events: none; }

.option-card .option-label {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.3;
  font-size: .9rem;
  letter-spacing: .02em;
}

.option-num {
  background: var(--black);
  color: var(--white);
  width: 22px;
  height: 22px;
  min-width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.option-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--grey-light);
  display: none;
}

.option-card.selected .option-desc { display: block; }

.option-res-chip {
  display: none;
  margin-top: 8px;
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 10px;
  width: fit-content;
  border: 1px solid;
}
.option-card.selected .option-res-chip { display: inline-block; }
.option-res-chip.neg { background: #fce8e8; color: var(--red); border-color: var(--red); }
.option-res-chip.pos { background: #d4f0dc; color: #1a5c2a; border-color: #1a5c2a; }

/* ─── Bouton "Changer d'action" ─── */
.change-action-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--off-white);
  border: 2px solid var(--grey-light);
  padding: 10px 12px;
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .82rem;
  font-weight: 900;
  color: var(--black);
  cursor: pointer;
  margin-top: 6px;
  letter-spacing: .03em;
  transition: border-color .15s, box-shadow .15s;
}

.change-action-btn:hover:not(.done) { border-color: var(--red); box-shadow: 2px 2px 0 var(--red); }
.change-action-btn.done { opacity: .45; cursor: default; pointer-events: none; }

/* ─── Naomi action button ─── */
.naomi-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--red-dark);
  padding: 9px 16px;
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
  margin-top: 10px;
  transition: box-shadow .15s, transform .15s;
  box-shadow: 3px 3px 0 var(--red-dark);
}

.naomi-action-btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--red-dark); }
.naomi-action-btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }

/* ─── Badges ─── */
.event-badge {
  display: inline-block;
  background: var(--yellow);
  color: var(--black);
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 2px 9px;
  margin-bottom: 5px;
}

.unlock-badge {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 2px 9px;
  margin-bottom: 5px;
}

.counter-badge {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 2px 9px;
  margin-bottom: 5px;
}

.result-scenario-text { font-size: .9rem; line-height: 1.6; margin-bottom: 4px; }

.chat-img { display: block; width: 500px; max-width: 100%; border: 2px solid rgba(255,255,255,.2); margin-top: 8px; }

/* ════════════════════════════════════════════
   CHAT INPUT AREA
════════════════════════════════════════════ */
.chat-bottom {
  position: sticky;
  bottom: 0;
  z-index: 150;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 4px;
  background: var(--off-white);
}

.qr-btn {
  background: var(--white);
  border: 2px solid var(--black);
  color: var(--black);
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: .04em;
  transition: background .12s, color .12s;
}

.qr-btn:hover, .qr-btn.active {
  background: var(--black);
  color: var(--white);
}

.chat-input-area {
  background: var(--off-white);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  animation: slideUp .25s ease;
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.chat-input-bubble {
  flex: 1;
  background: var(--white);
  border: 2px solid var(--black);
  padding: 9px 14px;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--text);
  min-height: 40px;
  max-height: 110px;
  overflow-y: auto;
  word-break: break-word;
}

.chat-input-bubble .cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--black);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: blink .7s steps(1) infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.chat-send-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--red-dark);
  padding: 10px 16px;
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: box-shadow .15s, transform .15s;
  box-shadow: 3px 3px 0 var(--red-dark);
}

.chat-send-btn:hover:not(:disabled) { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--red-dark); animation: none; }
.chat-send-btn:disabled { background: var(--grey); border-color: #555; cursor: not-allowed; transform: none; box-shadow: none; animation: none; }
.chat-send-btn.pulse { animation: btnPulse .7s ease-in-out infinite; }

/* ── Mode dormant ── */
.chat-input-area.dormant .chat-input-bubble {
  color: var(--text-muted);
  opacity: .5;
  pointer-events: none;
  user-select: none;
}
.chat-input-area.dormant .chat-send-btn {
  background: var(--grey);
  border-color: #555;
  cursor: not-allowed;
  opacity: .5;
  pointer-events: none;
  box-shadow: none;
}

.send-icon { font-size: .8rem; }

/* ── Bouton Actions ── */
.chat-actions-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--black);
  padding: 8px 12px;
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.cab-icon  { font-size: 1.1rem; line-height: 1; font-weight: 400; }
.cab-label { font-size: .78rem; font-weight: 900; }
.chat-actions-btn:hover  { background: var(--red); border-color: var(--red); animation: none; }
.chat-actions-btn.active { background: var(--yellow); color: var(--black); border-color: var(--yellow); animation: none; }

@keyframes btnPulse {
  0%, 100% { opacity: 1;    transform: scale(1); }
  50%       { opacity: .65; transform: scale(.94); }
}
.chat-actions-btn.pulse { animation: btnPulse .7s ease-in-out infinite; }

/* ════════════════════════════════════════════
   ACTIONS PANEL
════════════════════════════════════════════ */
.actions-panel {
  background: var(--black);
  overflow: hidden;
  max-height: 0;
  transition: max-height .35s cubic-bezier(.32,1,.56,1);
  border-top: 3px solid var(--yellow);
}
.actions-panel.open {
  max-height: 340px;
  overflow-y: auto;
}

.ap-grid {
  padding: 10px 8px 8px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  align-content: start;
}

@media (min-width: 480px) {
  .ap-grid { grid-template-columns: repeat(4, 1fr); }
  .actions-panel.open { max-height: 200px; }
}

/* ════════════════════════════════════════════
   STRATEGY PANEL
════════════════════════════════════════════ */
.strategy-panel {
  background: var(--off-white);
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s cubic-bezier(.32,1,.56,1);
  border-top: 3px solid var(--black);
}
.strategy-panel.open {
  max-height: 280px;
  overflow-y: auto;
}

.sp-header {
  padding: 8px 12px 4px;
  border-bottom: 2px solid var(--black);
  background: var(--black);
}
.sp-title {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .72rem;
  font-weight: 900;
  color: var(--yellow);
  letter-spacing: .06em;
}

.sp-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
}

/* Surcharges option-card dans strategy panel */
.sp-list .option-card { background: var(--white); border-color: var(--grey-light); color: var(--black); }
.sp-list .option-card:hover:not(.done) { background: var(--white); border-color: var(--black); box-shadow: 2px 2px 0 var(--black); }
.sp-list .option-card.selected { background: var(--white); border-color: var(--black); box-shadow: 3px 3px 0 var(--black); }
.sp-list .option-card .option-label { color: var(--black); }
.sp-list .option-card .option-num { background: var(--black); color: var(--white); }
.sp-list .option-card .option-desc { color: var(--text-muted); border-top-color: var(--grey-light); }
.sp-list .option-card.selected .option-desc { display: block; }
.sp-list .option-card.selected .option-res-chip { display: inline-block; }
.sp-list .option-res-chip.neg { background: #fce8e8; color: var(--red); border-color: var(--red); }
.sp-list .option-res-chip.pos { background: #d4f0dc; color: #1a5c2a; border-color: #1a5c2a; }

.ao-card {
  background: rgba(255,255,255,.06);
  border: 2px solid rgba(255,255,255,.12);
  padding: 8px 6px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ao-card:hover:not(.played):not(.locked) {
  background: rgba(255,230,0,.12);
  border-color: var(--yellow);
  transform: scale(1.02);
}

.ao-card.played { opacity: .35; cursor: not-allowed; pointer-events: none; }
.ao-card.locked { opacity: .35; cursor: not-allowed; pointer-events: none; }

.ao-card-icon-wrap {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.ao-card-title {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .91rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .02em;
}

.ao-card-played-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--yellow);
  color: var(--black);
  font-size: .55rem;
  font-weight: 900;
  padding: 2px 5px;
}

.ao-card-locked-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
  font-size: .55rem;
  font-weight: 700;
  padding: 2px 5px;
}

/* ════════════════════════════════════════════
   PUSH NOTIFICATION (contre-attaque)
════════════════════════════════════════════ */
.push-notification {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -130%);
  width: min(520px, calc(100vw - 16px));
  background: var(--red-dark);
  color: var(--white);
  border: 3px solid var(--black);
  box-shadow: 6px 6px 0 var(--black);
  padding: 16px 18px 18px;
  z-index: 2000;
  transition: transform .4s cubic-bezier(.32,1,.56,1);
}

.push-notification.show { transform: translate(-50%, 12px); }

.pn-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255,255,255,.3);
}

.pn-app-icon { font-size: 1.1rem; }
.pn-app-name {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .72rem;
  font-weight: 900;
  color: rgba(255,255,255,.85);
  flex: 1;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.pn-time { font-size: .7rem; color: rgba(255,255,255,.5); }

/* pn-close par défaut (fond rouge : push notification) */
.pn-close {
  background: rgba(0,0,0,.2);
  border: 2px solid rgba(255,255,255,.4);
  color: var(--white);
  cursor: pointer;
  font-size: .8rem;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.pn-close:hover { background: rgba(0,0,0,.4); }

/* pn-close dans les modales claires (calendrier + paramètres) */
.cal-modal .pn-close {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.35);
  color: var(--white);
}
.cal-modal .pn-close:hover { background: rgba(255,255,255,.25); }

/* pn-app-name dans les modales claires */
.cal-modal .pn-app-name { color: var(--yellow); }

.pn-body   { display: flex; gap: 14px; align-items: flex-start; }
.pn-avatar { font-size: 2.4rem; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.pn-content { flex: 1; min-width: 0; }

.pn-title {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .95rem;
  font-weight: 900;
  color: var(--yellow);
  margin-bottom: 7px;
  line-height: 1.3;
}

.pn-text { font-size: .9rem; color: rgba(255,255,255,.92); line-height: 1.6; }

.pn-deltas { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pn-deltas .delta-chip { font-size: .78rem; padding: 3px 10px; }

/* ════════════════════════════════════════════
   END / RESULT SCREENS
════════════════════════════════════════════ */
#screen-end, #screen-result {
  align-items: center;
  justify-content: flex-start;
  background: var(--yellow);
  padding: 40px 16px;
  min-height: 100vh;
  overflow-y: auto;
  animation: fadeIn .3s ease;
}

.end-box { max-width: 640px; width: 100%; color: var(--white); }
.end-box .end-icon { font-size: 4rem; display: block; text-align: center; margin-bottom: 16px; }

.end-box h2 {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: .02em;
  color: var(--black);
}

.end-box .end-subtitle { font-size: .82rem; text-align: center; color: var(--grey); margin-bottom: 20px; letter-spacing: .08em; }

.end-card {
  background: var(--off-white);
  border: 3px solid var(--red);
  color: var(--black);
  padding: 20px 24px;
  margin-bottom: 14px;
}

.end-card h3 {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: 1.07rem;
  letter-spacing: .08em;
  color: var(--grey-dark);
  margin-bottom: 10px;
  font-weight: 900;
}

.end-card p  { font-size: .93rem; line-height: 1.7; }
.end-card .cta-text { margin-top: 8px; }

.scores-summary { display: flex; gap: 10px; flex-wrap: wrap; }

.summary-item {
  flex: 1;
  min-width: 100px;
  text-align: center;
  background: var(--black);
  border: 2px solid var(--white);
  padding: 10px;
  color: var(--white);
}

.summary-item .si-icon  { font-size: 1.4rem; }
.summary-item .si-label { font-size: .91rem; color: var(--grey); margin: 2px 0; letter-spacing: .04em; }
.summary-item .si-val   {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
}

.actions-recap-list { list-style: decimal; padding-left: 20px; margin: 0; }

.actions-recap-list li {
  font-size: .88rem;
  line-height: 1.7;
  padding: 3px 0;
  border-bottom: 1px solid var(--grey-light);
}

.actions-recap-list li:last-child { border-bottom: none; }
.ar-phase { font-family: 'Arial Black', Arial, sans-serif; font-weight: 900; }

/* ─── Récap détaillé des actions et événements (écran de fin) ─── */
.actions-recap { display: flex; flex-direction: column; gap: 8px; }

.recap-turn {
  padding: 10px 12px;
  background: var(--white);
}

.recap-turn-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.recap-turn-num {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.recap-turn-phase {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-size: .82rem;
}

.recap-turn-action {
  font-size: .84rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}

.recap-deltas { display: flex; flex-direction: column; gap: 5px; }

.recap-delta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.recap-delta-label {
  font-size: .74rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 140px;
}

.recap-delta-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.recap-delta-chips .delta-chip { font-size: .74rem; padding: 2px 8px; }

.recap-event {
  background: #fffbee;
  border: 2px solid var(--yellow);
  padding: 10px 12px;
}

.recap-event-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.recap-event-icon { font-size: 1rem; }

.recap-event-title {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .82rem;
  font-weight: 900;
  flex: 1;
}

.recap-event-badge {
  font-size: .66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #d4a72c;
  color: #fff;
  padding: 2px 7px;
  white-space: nowrap;
}

.recap-event .recap-delta-chips { margin-top: 0; }

/* ─── Graphique de progression (écrans de fin) ─── */
.score-graph-wrap {
  background: #fff;
  border: 1px solid var(--grey-light);
  border-radius: 4px;
  padding: 10px 8px 4px;
  margin-bottom: 14px;
}

.graph-legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-bottom: 2px;
}

.graph-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .74rem;
  color: var(--text-muted);
}

.gl-line {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

.gl-line-evt {
  background: none;
  border-top: 2px dashed #d4a72c;
  height: 0;
}

/* ─── Accordéon "Voir le détail tour par tour" ─── */
.recap-accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--off-white);
  border: 2px solid var(--grey-light);
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .82rem;
  font-weight: 900;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
  letter-spacing: .03em;
}

.recap-accordion-btn:hover { background: var(--grey-light); border-color: var(--grey); }

.recap-accordion-btn[aria-expanded="true"] {
  border-bottom-color: transparent;
}

.recap-accordion-arrow {
  font-size: .75rem;
  flex-shrink: 0;
  transition: transform .2s;
}

.recap-accordion-body {
  border: 2px solid var(--grey-light);
  border-top: none;
  padding: 12px;
}

.hint-accordion-wrap {
  margin-top: 24px;
}

.hint-accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: #fffbe6;
  border: 2px solid #f0c040;
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .85rem;
  font-weight: 900;
  color: #7a5800;
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
  letter-spacing: .03em;
}

.hint-accordion-btn:hover { background: #fff3b0; border-color: #d4a800; }

.hint-accordion-btn[aria-expanded="true"] {
  border-bottom-color: transparent;
}

.hint-accordion-body {
  border-color: #f0c040 !important;
  background: #fffdf0;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--black)
}

.hint-list {
  padding-left: 20px;
  margin: 10px 0;
}

.hint-list li {
  margin-bottom: 8px;
}

.result-type-badge { text-align: center; margin-bottom: 18px; }

.result-type-badge span {
  display: inline-block;
  padding: 6px 20px;
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .1em;
  border: 2px solid;
  box-shadow: 3px 3px 0;
}

.badge-lobby-win    { background: var(--red);    color: var(--white); border-color: var(--red-dark); box-shadow: 3px 3px 0 var(--red-dark); }
.badge-statu-quo    { background: var(--yellow);  color: var(--black); border-color: #aa9900;        box-shadow: 3px 3px 0 #aa9900; }
.badge-partial-win  { background: #0055aa;        color: var(--white); border-color: #003a7a;        box-shadow: 3px 3px 0 #003a7a; }
.badge-complete-win { background: var(--black);   color: var(--yellow); border-color: #333;          box-shadow: 3px 3px 0 #333; }

/* ── Blocage interface pendant notification ── */
body.notif-open .chat-messages,
body.notif-open .chat-bottom,
body.notif-open .chat-header {
  pointer-events: none;
  user-select: none;
}

/* ════════════════════════════════════════════
   BOUTON PARAMÈTRES
════════════════════════════════════════════ */
.settings-btn {
  background: transparent;
  border: 2px solid rgba(255,255,255,.18);
  color: var(--white);
  cursor: pointer;
  font-size: 1.1rem;
  width: 60px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.settings-btn:hover { border-color: var(--yellow); background: rgba(255,230,0,.1); }

/* ════════════════════════════════════════════
   MODALE PARAMÈTRES
════════════════════════════════════════════ */
.settings-modal { min-width: 280px; max-width: 360px; width: 92vw; }

.settings-inner { display: flex; flex-direction: column; gap: 14px; }

/* Dans la modale (fond blanc), overrides des toggles */
.settings-toggle { color: var(--black); }
.settings-inner .wt-label { color: var(--black); font-size: .82rem; letter-spacing: .05em; }
.settings-inner .wt-box { border-color: var(--grey); background: transparent; }
.settings-inner .welcome-toggle input:checked + .wt-box { background: var(--black); border-color: var(--black); }
.settings-inner .welcome-toggle input:checked + .wt-box::after { border-color: var(--yellow); }

.settings-row { display: flex; flex-direction: column; gap: 8px; margin-top: 1rem; }

.settings-row-label {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--text-muted);
  font-weight: 900;
}

.settings-zoom-group { display: flex; gap: 6px; flex-wrap: wrap; }

.zoom-opt {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
}
.zoom-opt input { display: none; }
.zoom-opt {
  font-size: .85rem;
  color: var(--black);
  background: var(--off-white);
  border: 2px solid var(--grey-light);
  padding: 5px 11px;
  transition: background .12s, border-color .12s;
  user-select: none;
  font-weight: 700;
}
.zoom-opt:has(input:checked) {
  background: var(--black);
  border-color: var(--black);
  color: var(--yellow);
  font-weight: 900;
}
.zoom-opt:hover { border-color: var(--black); }

/* ════════════════════════════════════════════
   LAYOUT GAME (mobile first)
════════════════════════════════════════════ */
.game-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.game-sidebar { display: none; }

.game-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Desktop ≥1100px ── */
@media (min-width: 1100px) {
  html { height: 100%; overflow: hidden; }
  body { height: calc(100vh / var(--page-zoom, 1)); overflow: hidden; }

  /* Les écrans scrollables ont min-height: 100vh en mobile ;
     sur desktop la hauteur vient du flex et non du min-height,
     sinon min-height: 100vh dépasse la hauteur compensée du body. */
  #screen-welcome, #screen-about, #screen-end, #screen-result { min-height: 0; }

  #screen-game { overflow: hidden; }

  .game-layout {
    flex-direction: row;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
  }

  .game-sidebar {
    display: flex;
    flex-direction: column;
    width: 25%;
    flex-shrink: 0;
    background: var(--black);
    border-right: 3px solid var(--red);
    overflow-y: auto;
    gap: 0;
  }

  .game-chat {
    flex: 1;
    width: 100%;
    overflow: hidden;
  }

  /* Masquer les éléments du header déplacés dans la sidebar */
  .chat-header-scores { display: none; }
  .chat-header-row1 .chat-logo-btn { display: none; }
}

/* ════════════════════════════════════════════
   SIDEBAR CONTENU
════════════════════════════════════════════ */
.sb-logo-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  padding: 20px 16px 16px;
  cursor: pointer;
  width: 100%;
  opacity: .88;
  transition: opacity .15s, background .15s;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sb-logo-btn:hover { opacity: 1; background: rgba(255,255,255,.04); }

.sb-logo-img { width: 180px; max-width: 100%; display: block; }

/* Tour pill dans la sidebar */
.sb-tour-pill {
  width: 100%;
  height: auto;
  min-height: 64px;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 0;
  padding: 10px 14px;
}
.sb-tour-pill .chp-tour-name { max-width: none; font-size: .8rem; color: var(--white); }
.sb-tour-pill .chp-tour-num  { font-size: .62rem; }

/* Score items */
.sb-scores {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6px 0;
}

.sb-score-item {
  padding: 20px 14px;
  margin: 10px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.06);
  transition: background .3s;
}
.sb-score-item.danger  { background: rgba(232,0,28,.18);  border-left: 3px solid var(--red); }
.sb-score-item.warning { background: rgba(255,230,0,.08); border-left: 3px solid var(--yellow); }

.sb-score-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sb-score-icon { font-size: 1rem; flex-shrink: 0; }

.sb-score-label {
  flex: 1;
  font-size: .72rem;
  color: var(--grey);
  letter-spacing: .04em;
  line-height: 1.2;
}

.sb-score-val {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--yellow);
  flex-shrink: 0;
  transition: color .5s;
  min-width: 2.5ch;
  text-align: right;
}

.sb-bar-bg {
  height: 4px;
  background: rgba(255,255,255,.1);
  overflow: hidden;
}

.sb-bar {
  height: 100%;
  background: var(--yellow);
  width: 40%;
  transition: width .5s ease, background .3s;
}
.sb-bar.danger  { background: var(--red); }
.sb-bar.warning { background: var(--yellow); }

/* Boutons en bas de sidebar */
.sb-bottom {
  padding: 10px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sb-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--white);
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-align: left;
}
.sb-action-btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); }

/* ════════════════════════════════════════════
   LIEN À PROPOS (accueil)
════════════════════════════════════════════ */
.about-link {
  display: inline-block;
  margin-top: 1.5rem;
  background: none;
  border: none;
  font-size: .8rem;
  color: var(--text);
  cursor: pointer;
  letter-spacing: .05em;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s;
}
.about-link:hover { color: var(--black); }

/* ════════════════════════════════════════════
   ÉCRAN À PROPOS
════════════════════════════════════════════ */
#screen-about {
  background: var(--yellow);
  align-items: center;
  min-height: 100vh;
  overflow-y: auto;
  animation: fadeIn .25s ease;
}

.about-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 40px;
}

.about-topbar {
  width: 100%;
  max-width: 640px;
  padding: 14px 0 8px;
  display: flex;
  align-items: center;
}

.about-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 2px solid var(--black);
  color: var(--black);
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .05em;
  padding: 7px 16px;
  cursor: pointer;
  transition: background .15s, color .15s;
  box-shadow: 3px 3px 0 var(--black);
}
.about-back-btn:hover { background: var(--black); color: var(--yellow); }

/* ── Grille équipe (page À propos) ── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.team-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 3px solid var(--black);
  display: block;
}

.team-name {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: .9rem;
  font-weight: 900;
  color: var(--black);
  letter-spacing: .04em;
}

.team-role {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

@media (max-width: 400px) {
  .team-grid { grid-template-columns: 1fr; max-width: 180px; margin-inline: auto; }
}

/* ════════════════════════════════════════════
   LOGO CLIQUABLE DANS LE HEADER
════════════════════════════════════════════ */
.chat-logo-btn {
  background: none;
  border: none;
  padding: 0 8px 0 0;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  opacity: .85;
  transition: opacity .15s;
}
.chat-logo-btn:hover { opacity: 1; }
.chat-logo-img { height: 28px; width: auto; display: block; }

@media (min-width: 640px) {
  .chat-logo-img { height: 36px; }
}

/* ════════════════════════════════════════════
   MODALE QUITTER LA PARTIE
════════════════════════════════════════════ */
.quit-modal { max-width: 340px; }

.quit-modal-text {
  font-size: .95rem;
  line-height: 1.6;
  color: var(--black);
  margin-bottom: 20px;
}

.quit-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .chat-header-role   { display: none; }
  .sp-label           { display: none; }
  .sp-val             { font-size: .92rem; }
  .ao-grid            { padding: 10px; gap: 6px; }
  .ao-card            { padding: 10px 8px; }
  .ao-card-title      { font-size: .65rem; }
  .ao-card-icon-wrap  { width: 36px; height: 36px; font-size: 1.25rem; }
  .msg-row            { max-width: 93%; }
  .end-box h2         { font-size: 1.5rem; }
  .chat-send-btn span:first-child { display: none; }
}

@media (min-width: 640px) {
  .chat-header {
    flex-direction: row;
    align-items: center;
    padding: 10px 18px;
  }
  .chat-header-row1 { flex: 1; }
  .chat-header-scores {
    flex-shrink: 0;
    gap: 10px;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
  }
  .chp-tour-pill { height: 70px; }
  .score-pill {
    height: 70px;
    padding: 8px 14px;
    gap: 8px;
  }
  .sp-icon  { font-size: 1.4rem; }
  .sp-label { font-size: .7rem; white-space: nowrap; text-align: center; }
  .sp-val   { font-size: 1.7rem; line-height: 1; }
  .sp-bar-bg { margin-top: 4px; }
}

/* ── Animation delta flottant ── */
.score-delta-float {
  position: fixed;
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  pointer-events: none;
  z-index: 3000;
  transform: translateX(-50%);
  animation: floatUp 2s ease-out forwards;
  color: var(--white);
  padding: 3px 9px;
  white-space: nowrap;
}

.score-delta-float.pos { background: #1a5c2a; border: 2px solid #0f3a1a; }
.score-delta-float.neg { background: var(--red); border: 2px solid var(--red-dark); }

@keyframes floatUp {
  0%   { opacity: 1;   transform: translateX(-50%) translateY(0)     scale(1); }
  20%  { opacity: 1;   transform: translateX(-50%) translateY(-6px)  scale(1.25); }
  100% { opacity: 0;   transform: translateX(-50%) translateY(-55px) scale(.85); }
}

/* ════════════════════════════════════════════
   ACCESSIBILITÉ RGAA
════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 10px 18px;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  z-index: 10000;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.ao-card:focus-visible,
.option-card:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
  z-index: 1;
  position: relative;
}

.chp-tour-pill:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
