/* NOIR — first-visit tutorial «ليلتك الأولى في ڤالمورا» (tutorial.js). Uses the game's tokens from style.css. */
html.tut-open, html.tut-open body { overflow: hidden; }

.tut {
  position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column;
  background: var(--page-bg); color: var(--smoke); font-family: var(--f-body);
  animation: tut-in .35s ease-out;
}
.tut::before {  /* the game's rain, inside the overlay */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12;
  background-image: repeating-linear-gradient(105deg, transparent 0 22px, rgba(180, 200, 230, .35) 22px 23px);
  animation: tut-rain 1.4s linear infinite;
}
@keyframes tut-rain { from { background-position: 0 0; } to { background-position: -120px 400px; } }
:root[data-theme="light"] .tut::before { display: none; }
.tut-bar, .tut-stage { position: relative; z-index: 1; }
.tut.out { animation: tut-out .28s ease-in forwards; pointer-events: none; }
@keyframes tut-in { from { opacity: 0; } }
@keyframes tut-out { to { opacity: 0; } }

/* top bar: progress, sound, skip */
.tut-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--bar-bg);
}
.tut-steps { display: flex; gap: 5px; flex-wrap: wrap; transition: opacity .3s; }
.tut.is-intro .tut-steps { opacity: 0; }
.tut-step {
  font-size: .74rem; line-height: 1.6; padding: 0 .65em; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--fog); white-space: nowrap;
}
.tut-step.on { border-color: var(--amber); color: var(--amber); }
.tut-step.done { border-color: var(--ok); color: var(--ok); }
.tut-step.done::before { content: "✓ "; }
.tut-tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; flex: none; }
.tut-sound {
  font: inherit; font-size: .95rem; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: none; border: 1px solid var(--line-2); color: var(--smoke); display: grid; place-items: center;
}
.tut-skip {
  font: inherit; font-size: .84rem; background: none; border: 0; color: var(--fog); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; padding: 6px 2px;
}
.tut-skip:hover, .tut-sound:hover { color: var(--title); }

.tut-stage { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 32px; -webkit-overflow-scrolling: touch; }
.tut-inner { max-width: 560px; margin: 0 auto; }
.tut-fade { animation: tut-fade .35s ease-out; }
@keyframes tut-fade { from { opacity: 0; transform: translateY(8px); } }

/* cold open */
.tut-inner:has(.tut-intro) { height: 100%; }
.tut-intro { min-height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 4vh 4px; }
.tut-dateline { font-family: "Special Elite", var(--f-head); color: var(--amber); letter-spacing: .08em; font-size: .95rem; min-height: 1.6em; }
.tut-quote { font-family: var(--f-quote); color: var(--title); font-size: 1.45rem; line-height: 1.75; margin: 0; min-height: 5.2em; }
.tut-sign { color: var(--fog); font-size: .9rem; opacity: 0; transition: opacity .6s; }
.tut-go-wrap { opacity: 0; transform: translateY(6px); transition: opacity .5s .15s, transform .5s .15s; pointer-events: none; }
.tut-sign.show { opacity: 1; }
.tut-go-wrap.show { opacity: 1; transform: none; pointer-events: auto; }
.tut-note { text-align: center; margin-top: .6em; }
.tut-caret::after { content: "▍"; color: var(--amber); margin-inline-start: 2px; animation: tut-blink 1s steps(1) infinite; }
@keyframes tut-blink { 50% { opacity: 0; } }

/* case header and the chief's one-line hints */
.tut-head { margin-bottom: 6px; }
.tut-head h2 { margin: 0; font-size: 1.35rem; }
.tut-kicker { font-size: .76rem; color: var(--amber); letter-spacing: .04em; }
.tut-coach {
  display: flex; gap: 8px; align-items: baseline; margin: 10px 0 14px; padding: 9px 12px;
  background: var(--ink-2); border: 1px solid var(--line); border-inline-start: 3px solid var(--amber);
  border-radius: 8px; color: var(--title); animation: tut-fade .3s ease-out;
}
.tut-coach b { color: var(--amber); font-size: .76rem; white-space: nowrap; font-family: var(--f-head); }

/* what to tap next */
.tut-glow { border-color: var(--amber) !important; animation: tut-pulse 1.6s ease-out infinite; }
@keyframes tut-pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 169, 67, .65); }
  70% { box-shadow: 0 0 0 11px rgba(224, 169, 67, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 169, 67, 0); }
}
.tut-dim { opacity: .4; filter: grayscale(.5); }

/* 1. search */
.tut-roomhead { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.tut-roomhead h3 { margin: 0; }
.tut-roomhead .tut-flag { margin: 0; }
.tut-spots { grid-template-columns: repeat(3, 1fr); }
.tut-spots .spot { min-height: 118px; }
.tut-spots .spot.empty .spot-state { font-size: .75rem; }
.tut-flag {
  display: inline-block; font-size: .68rem; color: var(--blood); border: 1px solid var(--blood);
  border-radius: 4px; padding: 0 .5em; margin-bottom: 4px;
}
.tut-evidence {
  position: relative; margin: 18px 6px 0; padding: 14px 16px; border-radius: 6px;
  background: var(--paper); color: var(--paper-ink); box-shadow: var(--shadow);
  transform: rotate(-1.2deg); animation: tut-drop .5s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes tut-drop { from { opacity: 0; transform: translateY(-16px) rotate(-6deg) scale(1.05); } }
.tut-ev-tag { font-family: "Special Elite", var(--f-head); font-size: .74rem; color: var(--blood); letter-spacing: .06em; }
.tut-ev-title { font-family: var(--f-head); font-weight: 700; font-size: 1.12rem; }
.tut-ev-body { font-family: "Special Elite", var(--f-body); font-size: .98rem; }

/* 2–3. question and confront */
.tut-suspects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.tut-suspect {
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 10px 6px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); opacity: .5;
}
.tut-suspect.is-on { opacity: 1; border-color: var(--amber); }
.tut-suspect .avatar { width: 40px; height: 40px; font-size: 1.05rem; }
.tut-suspect b { color: var(--title); font-family: var(--f-head); line-height: 1.3; }
.tut-suspect small { color: var(--fog); font-size: .7rem; line-height: 1.35; }
.tut-room { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tut-dossier { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.tut-name { font-family: var(--f-head); color: var(--title); font-size: 1.12rem; line-height: 1.3; }
.tut-dossier .meta { font-size: .8rem; color: var(--fog); }
.tut-dossier .meters { max-width: 240px; margin: 0; }
.tut-dossier .meter > i { transition: width .9s ease; }
.tut-dossier .pillar { transition: color .3s, border-color .3s, background .3s; }
.tut-dossier .pillar.on { background: rgba(192, 57, 43, .12); }
.tut-log { max-height: none; min-height: 140px; }
.tut-log .a { position: relative; }
.tut-log .tut-shown { border-color: var(--amber); }
.tut-typing { align-self: flex-end; display: flex; gap: 4px; padding: 10px 14px; background: var(--paper); border-radius: 12px 12px 2px 12px; }
.tut-typing i { width: 7px; height: 7px; border-radius: 50%; background: #8a7f69; animation: tut-dot 1s infinite; }
.tut-typing i:nth-child(2) { animation-delay: .15s; }
.tut-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tut-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.tut-actions { padding: 0 14px 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.tut-actions:empty { display: none; }
.tut-actions .chip { font-size: .92rem; padding: .35em 1em; }
.tut-present { width: 100%; }

/* the contradiction stamp */
.tut-burst { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 3; }
.tut-burst span {
  font-family: var(--f-head); font-weight: 800; font-size: 1.55rem; color: var(--blood);
  border: 4px solid var(--blood); border-radius: 8px; padding: .15em .8em; background: rgba(13, 14, 16, .9);
  transform: rotate(-6deg); box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
  animation: tut-stamp .45s cubic-bezier(.2, 1.5, .4, 1) both, tut-gone .45s 1.6s ease-in forwards;
}
@keyframes tut-stamp { from { opacity: 0; transform: rotate(-6deg) scale(2.3); } }
@keyframes tut-gone { to { opacity: 0; transform: rotate(-6deg) scale(.96); } }

/* 4. accuse */
.tut-accuse { display: grid; gap: 10px; }
.tut-pick {
  font: inherit; display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; cursor: pointer;
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; color: var(--smoke);
  transition: border-color .15s, background .15s;
}
.tut-pick:hover { border-color: var(--smoke); }
.tut-pick b { display: block; color: var(--title); font-family: var(--f-head); font-size: 1.05rem; line-height: 1.3; }
.tut-pick small { color: var(--fog); font-size: .8rem; }
.tut-pick.tut-wrong { border-color: var(--blood); opacity: .55; }
.tut-pick.tut-right { border-color: var(--ok); background: rgba(111, 174, 114, .12); }
.tut-pick:disabled { cursor: default; }
.tut-shake { animation: tut-shake .4s; }
@keyframes tut-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* verdict */
.tut-verdict { text-align: center; padding-top: 6px; }
.tut-solved {
  display: inline-block; font-family: var(--f-head); font-weight: 800; font-size: 1.5rem; color: var(--ok);
  border: 3px solid var(--ok); border-radius: 6px; padding: 0 .9em; transform: rotate(-4deg);
  animation: tut-stamp .5s cubic-bezier(.2, 1.5, .4, 1) both;
}
.tut-grade { margin: 10px 0 4px; }
.tut-grade span { color: var(--fog); font-size: .8rem; }
.tut-verdict .verdict-grade { font-size: 64px; }
.tut-verdict .debrief { text-align: start; margin: 10px 0; }
.tut-tip { margin: 10px 0 4px; }

.tut-next { margin-top: 16px; }

@media (max-width: 380px) {
  .tut-bar { padding: 8px 10px; }
  .tut-step { font-size: .68rem; padding: 0 .5em; }
  .tut-quote { font-size: 1.28rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tut, .tut *, .tut-burst span { animation: none !important; transition: none !important; }
}
