/* Correction de la superposition des couches dans la salle d'investigation */
#interrogation-scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
#interrogation-scene .layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
#interrogation-scene .background-layer {
  z-index: 0;
}
#interrogation-scene .suspect-layer {
  z-index: 1;
}
#interrogation-scene .foreground-layer {
  z-index: 2;
}
#interrogation-scene .table-layer {
  z-index: 3;
}

#interrogation-scene .ui-layer {
  z-index: 4;
  color: #fff;
  /* Pour garantir la lisibilité */
  text-shadow: 1px 1px 4px #000, 0 0 8px #000;
  pointer-events: none;
}

#interrogation-scene .ui-layer .menu-btn,
#interrogation-scene .ui-layer .questions-panel,
#interrogation-scene .ui-layer .question-option,
#interrogation-scene .ui-layer .response-bubble,
#interrogation-scene .ui-layer .add-note-bubble,
#interrogation-scene .ui-layer .temperature-gauge,
#interrogation-scene .ui-layer .clock {
  pointer-events: auto;
}

#interrogation-scene .finish-btn {
  position: absolute;
  right: 40px;
  bottom: 40px;
  display: none;
  transition: opacity 0.2s ease;
}

#interrogation-scene .finish-btn.is-visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Background / Foreground */
#interrogation-scene .scene-bg,
#interrogation-scene .scene-fg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#interrogation-scene .scene-fg {
  z-index: 10;
  pointer-events: none;
}

/* Suspect */
#interrogation-scene .suspect-img {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-45%);
  height: 520px;
  width: auto;
  z-index: 5;
}

/* Table items */
#interrogation-scene .table-items {
  position: relative;
  width: 100%;
  height: 100%;
}

#interrogation-scene .notebook-container,
#interrogation-scene .context-container {
  display: inline-block;
  position: absolute;
  bottom: 40px;
  width: 230px;
  z-index: 14;
  pointer-events: auto;
}

#interrogation-scene .notebook-container {
  aspect-ratio: 404 / 201;
  left: calc(50% + 160px);
}

#interrogation-scene .context-container {
  aspect-ratio: 312 / 223;
  left: calc(50% - 360px);
}

#interrogation-scene .table-item-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  z-index: 12;
  cursor: pointer;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
}

#interrogation-scene .table-item-img.hover-img {
  z-index: 13;
  display: block;
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}

#interrogation-scene .notebook-container:hover #notebook-hover,
#interrogation-scene .context-container:hover #context-hover,
#interrogation-scene .notebook-container.is-hovered #notebook-hover,
#interrogation-scene .context-container.is-hovered #context-hover {
  opacity: 1;
  visibility: visible;
}

#interrogation-scene #notebook-solid:hover + #notebook-hover,
#interrogation-scene #context-solid:hover + #context-hover {
  opacity: 1;
  visibility: visible;
}

/* Notebook overlay */
#interrogation-scene .notebook-overlay,
#interrogation-scene .context-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#interrogation-scene .notebook-overlay.is-visible,
#interrogation-scene .context-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

#interrogation-scene .notebook-panel,
#interrogation-scene .context-panel {
  position: relative;
  width: 80%;
  height: 80%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#interrogation-scene .notebook-panel {
  padding: 40px;
  flex-direction: column;
  gap: 18px;
  justify-content: flex-start;
}

#interrogation-scene .notebook-title {
  font-size: 1.8rem;
  letter-spacing: 0.16em;
  text-align: center;
}

#interrogation-scene .notebook-notes {
  width: 100%;
  max-height: 70%;
  overflow-y: auto;
  text-align: left;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  line-height: 1.4;
  padding-right: 10px;
  margin-bottom: 60px;
}

/* Lineup scene */
.lineup-screen {
  position: absolute;
  inset: 0;
  background: #0e0e0e;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.lineup-header {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.lineup-title {
  font-size: 2rem;
  letter-spacing: 0.2em;
}

.lineup-suspects {
  display: flex;
  gap: 60px;
  align-items: flex-end;
}

.lineup-suspect img {
  height: 420px;
  width: auto;
  display: block;
  transition: transform 0.2s ease;
}

.lineup-label {
  text-align: center;
  margin-top: 12px;
  letter-spacing: 0.12em;
}

.lineup-suspect {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.lineup-suspect:hover {
  transform: scale(1.06);
}

.lineup-result {
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  min-height: 2.2rem;
}

.lineup-replay-btn {
  margin-top: -6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lineup-replay-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.lineup-result.is-win {
  color: #9dff9d;
}

.lineup-result.is-lose {
  color: #ff9d9d;
}

.lineup-notebook-btn {
  position: absolute;
  left: 40px;
  bottom: 40px;
}

.lineup-notebook-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.lineup-notebook-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.lineup-notebook-panel {
  position: relative;
  width: 80%;
  height: 80%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  justify-content: flex-start;
}

.lineup-notebook-title {
  font-size: 1.8rem;
  letter-spacing: 0.16em;
}

.lineup-notebook-index {
  font-size: 1.2rem;
  letter-spacing: 0.12em;
}

.lineup-notebook-notes {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  text-align: left;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  line-height: 1.4;
  padding-right: 10px;
}

.lineup-notebook-notes .note-item {
  margin-bottom: 14px;
}

.lineup-notebook-notes .note-divider {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 14px;
}

.lineup-notebook-actions {
  display: flex;
  gap: 26px;
  margin-bottom: 60px;
}

.lineup-close-btn {
  position:relative;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
}

.lineup-context-btn {
  position: absolute;
  right: 40px;
  bottom: 40px;
}

.lineup-context-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.lineup-context-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.lineup-context-panel {
  position: relative;
  width: 80%;
  height: 80%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lineup-context-panel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lineup-context-label {
  position: absolute;
  top: 24px;
  right: 28px;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
}

.lineup-context-next {
  position: absolute;
  right: 28px;
  bottom: 24px;
}

.lineup-context-close {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
}

#interrogation-scene .note-item {
  margin-bottom: 14px;
  display: block;
}

#interrogation-scene .note-divider {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 14px;
}

#interrogation-scene .context-panel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#interrogation-scene .context-page-label {
  position: absolute;
  top: 24px;
  right: 28px;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
}

#interrogation-scene .context-next-btn {
  position: absolute;
  right: 100%;
  transform: translateX(-50%);
  bottom: 300px;

}

#interrogation-scene .context-close-btn,
#interrogation-scene .notebook-close-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
}

#interrogation-scene .context-close-btn,
#interrogation-scene .notebook-close-btn,
.lineup-close-btn,
.lineup-context-close {
  padding: 0;
  line-height: 1;
  height: 55px;
  min-height: 0;
}

#interrogation-scene .add-note-bubble.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Menu button */
#interrogation-scene .menu-btn {
  position: absolute;
  top: 24px;
  left: 32px;
  transform: none;
  z-index: 20;
}

/* Questions panel (top-left) */
#interrogation-scene .questions-panel {
  position: absolute;
  top: 50%;
  left: 48px;
  transform: translateY(-50%);
  width: 460px;
  padding: 6px 0;
  background: transparent;
  border: none;
  z-index: 20;
}

#interrogation-scene .questions-title {
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  text-align: left;
}

#interrogation-scene .question-prompt {
  font-size: 1.25rem;
  line-height: 1.3;
  opacity: 0.95;
  margin-bottom: 16px;
}

#interrogation-scene .question-option {
  width: 100%;
  margin: 0 0 14px 0;
  padding: 10px 0 12px 0;
  text-align: left;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: "VCR", monospace;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#interrogation-scene .question-option.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#interrogation-scene .question-option:disabled {
  pointer-events: none;
}

#interrogation-scene .question-option:hover {
  color: #ffe8a6;
  text-shadow: 0 0 8px rgba(255, 232, 166, 0.5);
}

#interrogation-scene .question-option:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

/* Response bubble (above suspect) */
#interrogation-scene .response-bubble {
  position: absolute;
  top: 210px;
  left: 50%;
  transform: translateX(-50%);
  width: 520px;
  min-height: 80px;
  padding: 12px 0;
  background: transparent;
  border: none;
  z-index: 22;
  text-align: center;
}

#interrogation-scene .response-text {
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

/* Notice centrale (ex: Suspect suivant / L'avocat est arrivé) */
#interrogation-scene .interrogation-notice {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
  background: rgba(0, 0, 0, 0.92);
  border: none;
  font-size: 2.8rem;
  letter-spacing: 0.2em;
  text-align: center;
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#interrogation-scene .interrogation-notice.is-visible {
  opacity: 1;
}

/* Add to notebook bubble */
#interrogation-scene .add-note-bubble {
  position: absolute;
  right: 300px;
  bottom: 360px;
  padding: 8px 0;
  background: transparent;
  border: none;
  z-index: 22;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
}

#interrogation-scene .add-note-bubble.is-hidden {
  opacity: 0;
  pointer-events: none;
}

#interrogation-scene .add-note-bubble:hover {
  color: #ffe8a6;
  text-shadow: 0 0 8px rgba(255, 232, 166, 0.5);
}

/* Temperature gauge (right) */
#interrogation-scene .temperature-gauge {
  position: absolute;
  right: 48px;
  top: 50%;
  transform: translateY(-50%);
  width: 120px;
  height: 520px;
  padding: 10px 8px;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  z-index: 21;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  overflow: hidden;
}

#interrogation-scene .gauge-label {
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  opacity: 0.9;
  margin-top: 6px;
}

#interrogation-scene .gauge-bar {
  width: 36px;
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45);
}

#interrogation-scene .temperature-gauge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.08) 7px,
    rgba(255, 255, 255, 0.02) 7px,
    rgba(255, 255, 255, 0.02) 14px
  );
  mix-blend-mode: screen;
  opacity: 0.5;
  pointer-events: none;
}

#interrogation-scene .temperature-gauge::after {
  content: "";
  position: absolute;
  inset: -8px;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

#interrogation-scene .gauge-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(180deg, #ff2b2b 0%, #ff8a00 45%, #3ccf6b 100%);
}


/* Clock en haut à droite, plus grande */
#interrogation-scene .clock, #clock-ui {
  position: absolute;
  top: 24px;
  right: 40px;
  font-size: 2.9rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  color: #fff;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: 30;
}
#interrogation-scene .context-action-btn {
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  padding: 0;
  line-height: 1;
  height: auto;
}
