/* eggs.css — les portes cachées : digicode, rushes, BlackBerry, fenêtre 14, insomnie */

/* ---------- porte cochère (digicode) ---------- */
#porte-cochere {
  position: absolute;
  cursor: pointer;
  background: none;
  border: 0;
  opacity: 0;
  transition: opacity .6s ease;
}
#porte-cochere::after {
  content: "";
  position: absolute; inset: -12px;           /* zone de tap élargie */
}
#porte-cochere:hover,
#porte-cochere:focus-visible,
#porte-cochere.revealed {
  opacity: .55;
}
#porte-cochere:focus-visible { outline: 2px solid var(--ambre); outline-offset: 4px; }

/* ---------- digicode : plaque laiton nocturne ---------- */
.egg-digicode {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 28px 30px;
  background: linear-gradient(160deg, #17140E, #0C0B08 65%);
  border: 1px solid rgba(220, 168, 86, .28);
  border-radius: 6px;
}
.egg-digi-screen {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: .55em; text-indent: .55em;
  font-size: 22px; color: var(--ambre);
  padding: 10px 18px;
  background: #060505;
  border: 1px solid rgba(220, 168, 86, .18);
  border-radius: 3px;
  min-width: 8ch; text-align: center;
}
.egg-digi-grid {
  display: grid; grid-template-columns: repeat(3, 64px); gap: 10px;
  justify-items: center;
}
.egg-digi-key {
  width: 64px; height: 52px;
  font-family: var(--sans); font-size: 17px;
  color: var(--blanc);
  background: radial-gradient(circle at 35% 30%, #241E12, #14110A);
  border: 1px solid rgba(220, 168, 86, .22);
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s, transform .08s;
}
.egg-digi-key:hover { background: radial-gradient(circle at 35% 30%, #2E2617, #17130B); }
.egg-digi-key:active { transform: translateY(1px); }
.egg-digi-key:focus-visible { outline: 2px solid var(--ambre); outline-offset: 2px; }
.egg-digi-grid .egg-digi-key:last-child { grid-column: 2; }
.egg-digi-hint { font-size: 12px; color: #6E675C; font-style: italic; max-width: 24ch; text-align: center; }

.egg-shake { animation: egg-shake .45s ease; }
@keyframes egg-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(2px); }
}

/* ---------- les rushes : chutes de pellicule ---------- */
.dlg-rushes { max-width: min(560px, 92vw); }
.egg-rushes-titre {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 26px; color: var(--or); margin-bottom: 18px;
}
.egg-pellicule {
  display: flex; flex-direction: column; gap: 0;
  max-height: 70vh; overflow-y: auto;
  background: #050505;
  /* perforations de pellicule des deux côtés */
  padding: 8px 34px;
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 6px, #111 6px 18px, transparent 18px 24px),
    repeating-linear-gradient(to bottom, transparent 0 6px, #111 6px 18px, transparent 18px 24px);
  background-size: 14px 100%, 14px 100%;
  background-position: 8px 0, calc(100% - 8px) 0;
  background-repeat: repeat-y, repeat-y;
}
.egg-frame { margin: 0; padding: 10px 0 4px; border-bottom: 1px dashed #1A1A1A; }
.egg-frame img { width: 100%; height: auto; display: block; filter: contrast(1.02); }
.egg-frame-cap {
  font-family: var(--sans); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: #5C574E; padding: 6px 2px 8px;
}

/* ---------- notification BlackBerry ---------- */
.egg-bb-notif {
  position: fixed; top: 18px; right: 18px; z-index: 60;
  font-family: var(--sans); font-size: 12px; letter-spacing: .04em;
  color: var(--blanc);
  background: #14131A;
  border: 1px solid rgba(101, 148, 183, .35);
  border-left: 3px solid var(--bleu2);
  padding: 10px 16px; border-radius: 3px;
  cursor: pointer;
  animation: bb-in .5s cubic-bezier(.22, 1, .36, 1), bb-vibre .18s linear .5s 2;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
}
.egg-bb-notif.gone { opacity: 0; transition: opacity .5s; }
.egg-bb-notif:focus-visible { outline: 2px solid var(--bleu2); outline-offset: 2px; }
@keyframes bb-in { from { transform: translateY(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bb-vibre { 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }

/* ---------- fil SMS ---------- */
.dlg-sms { max-width: min(420px, 92vw); }
.egg-sms-head {
  font-family: var(--sans); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: #6E675C; margin-bottom: 16px; text-align: center;
}
.egg-sms-fil { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow-y: auto; padding: 4px 2px; }
.egg-sms-row { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; }
.egg-sms-h {
  font-family: var(--sans); font-variant-numeric: tabular-nums;
  font-size: 10px; color: #55504A; padding-top: 9px;
}
.egg-bulle {
  background: #141318;
  border: 1px solid #201F26;
  border-radius: 3px 10px 10px 10px;
  padding: 9px 13px;
  font-size: 14px; line-height: 1.5; color: var(--blanc);
}
.egg-sms-vu {
  text-align: right; font-family: var(--sans); font-size: 10.5px;
  color: #55504A; font-style: italic; padding-top: 4px;
}

/* ---------- la quatorzième fenêtre ---------- */
[data-window="all-i-want-is-you"] { cursor: pointer; }
[data-window="all-i-want-is-you"].knocked { animation: w14-knock .22s ease; }
@keyframes w14-knock {
  30% { transform: scale(.985); filter: brightness(1.5); }
}
[data-window="all-i-want-is-you"] .halo { opacity: 0; transition: opacity 2.2s ease; }
[data-window="all-i-want-is-you"].lit .halo { opacity: .9; }
[data-window="all-i-want-is-you"].lit-forever .halo { opacity: .25; }

/* ---------- mode insomnie ---------- */
html.insomnie #tc { color: var(--bleu2); }
html.insomnie #grain { opacity: .08; }
html.insomnie .fenetre .halo { opacity: .04 !important; transition: opacity 1.8s ease; }
html.insomnie [data-window="juste-un-poeme"] .halo { opacity: 1 !important; }
html.insomnie [data-window="all-i-want-is-you"].lit .halo,
html.insomnie [data-window="all-i-want-is-you"].lit-forever .halo { opacity: .12 !important; }

/* ---------- la ligne 4h07 : rien à voir ici ---------- */
#ligne-4h07 { cursor: text; }

/* ---------- toast générique (utilisé par insomnie) ---------- */
.nuit-toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  z-index: 55;
  font-family: var(--serif); font-style: italic; font-size: 15px;
  color: var(--or);
  background: rgba(8, 9, 11, .92);
  border: 1px solid rgba(220, 168, 86, .2);
  padding: 10px 22px; border-radius: 3px;
  animation: toast-in .5s ease, toast-out .8s ease 4.2s forwards;
  pointer-events: none;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { to { opacity: 0; } }

/* ---------- pulse du téléphone (rattrapage seq6) ---------- */
#bb-phone { cursor: pointer; background: none; border: 0; position: absolute; }
#bb-phone.pulse::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 4px;
  box-shadow: 0 0 0 0 rgba(101, 148, 183, .55);
  animation: bb-pulse 1.6s ease-out 2;
}
#bb-phone:focus-visible { outline: 2px solid var(--bleu2); outline-offset: 3px; }
@keyframes bb-pulse {
  from { box-shadow: 0 0 0 0 rgba(101, 148, 183, .55); }
  to { box-shadow: 0 0 0 22px rgba(101, 148, 183, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .egg-bb-notif, .egg-shake, [data-window="all-i-want-is-you"].knocked, #bb-phone.pulse::after {
    animation: none;
  }
}


/* ── findings P1 : portes des eggs positionnées et atteignables ── */
#porte-cochere {
  position: absolute; left: 46%; bottom: 1.2%; width: 9%; height: 6.5%;
  min-width: 44px; min-height: 44px;
  background: transparent; border: 0; cursor: pointer; z-index: 4;
  border-radius: 2px;
}
#porte-cochere::after { content: ''; position: absolute; inset: -8px; }
#porte-cochere:hover, #porte-cochere:focus-visible {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--or, #B8A67E) 45%, transparent);
}
#porte-cochere:focus-visible { outline: 2px solid var(--ambre, #DCA856); outline-offset: 2px; }
#bb-phone {
  position: absolute; right: 8%; bottom: 10%; width: 48px; height: 48px;
  background: transparent; border: 0; cursor: pointer; z-index: 4; border-radius: 3px;
}
#bb-phone::before {
  content: ''; position: absolute; inset: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--bleu2, #6594B7) 55%, transparent);
  border-radius: 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bleu2, #6594B7) 22%, transparent), transparent);
}
#bb-phone:hover::before, #bb-phone:focus-visible::before {
  border-color: var(--bleu2, #6594B7);
  box-shadow: 0 0 12px color-mix(in srgb, var(--bleu2, #6594B7) 40%, transparent);
}
#bb-phone:focus-visible { outline: 2px solid var(--bleu2, #6594B7); outline-offset: 2px; }

/* dialogs des eggs : seule la langue active (spans .fr/.en sans attribut lang) */
html[data-lang="fr"] :is(#dlg, .nuit-toast, .egg-bb-notif) .en:not(.bl .en) { display: none; }
html[data-lang="en"] :is(#dlg, .nuit-toast, .egg-bb-notif) .fr:not(.bl .fr) { display: none; }

/* cibles tactiles : zone de frappe élargie sur toutes les fenêtres */
.fx-window::after { content: ''; position: absolute; inset: -10px; }
.fx-window[data-window="all-i-want-is-you"]::after { inset: -16px; }
