/* Markets of War — guided tutorial: spotlight, mentor card, chapter menu. Tokens from base.css. */
.tut-mount { position: absolute; inset: 0; }
.tut-game { position: absolute; inset: 0; }
.tut-root { position: absolute; inset: 0; pointer-events: none; z-index: var(--z-tutorial); }
.tut-layer { position: fixed; inset: 0; pointer-events: none; z-index: var(--z-tutorial); }

/* dimming: either a full veil (no target) or a cut-out around the target */
.tut-dim { position: fixed; inset: 0; background: rgba(12,8,4,.6); opacity: 0; transition: opacity .3s var(--ease); }
.tut-dim.is-on { opacity: 1; }
.tut-layer.is-menu .tut-dim, .tut-layer.is-final .tut-dim { opacity: 0; }
.tut-hole {
  position: fixed; left: 0; top: 0; width: 0; height: 0; border-radius: 12px; opacity: 0;
  box-shadow: 0 0 0 200vmax rgba(12,8,4,.6); transition: opacity .25s, left .22s var(--ease), top .22s var(--ease), width .22s var(--ease), height .22s var(--ease);
}
.tut-hole.is-on { opacity: 1; }
.tut-hole::after {
  content: ""; position: absolute; inset: -3px; border-radius: 14px; border: 2px solid var(--brass-hi);
  box-shadow: 0 0 0 1px rgba(43,33,24,.7), 0 0 18px 4px rgba(233,196,106,.45); animation: tut-pulse 1.7s ease-in-out infinite;
}
.tut-layer.is-waiting .tut-hole { box-shadow: 0 0 0 200vmax rgba(12,8,4,.22); }
.tut-layer.is-waiting .tut-dim { background: rgba(12,8,4,.2); }
.tut-layer.is-between .tut-dim, .tut-layer.is-between .tut-hole { opacity: 0; }
@keyframes tut-pulse { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.025); } }

/* pointer chevron next to the target */
.tut-ptr {
  position: fixed; left: 0; top: 0; width: 26px; height: 26px; color: var(--gold); opacity: 0; transform: rotate(var(--rot, 0deg));
  filter: drop-shadow(0 0 2px #2b2118) drop-shadow(0 2px 4px rgba(0,0,0,.6)); transition: opacity .2s;
}
.tut-ptr.is-on { opacity: 1; }
.tut-ptr svg { display: block; animation: tut-nudge-x 1.1s ease-in-out infinite; }
@keyframes tut-nudge-x { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(4px); } }

/* the mentor's card */
.tut-card {
  position: fixed; left: 0; top: 0; width: min(390px, calc(100vw - 20px)); pointer-events: auto; padding: 12px 14px 12px;
  border: 1px solid var(--brass); box-shadow: var(--shadow-lift), inset 0 0 40px rgba(122,95,53,.28);
  opacity: 0; transition: left .28s var(--ease), top .28s var(--ease), opacity .2s; font-size: 1rem; line-height: 1.42;
}
.tut-card.is-placed { opacity: 1; }
.tut-card::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(122,95,53,.35); border-radius: 9px; pointer-events: none; }
.tut-head { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; }
.tut-face { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brass); box-shadow: 0 0 0 2px rgba(43,33,24,.5), 0 3px 6px rgba(0,0,0,.35); background: #6b5030; }
.tut-face--lg { width: 76px; height: 76px; }
.tut-who { display: grid; line-height: 1.15; min-width: 0; }
.tut-who b { font: 600 1.02rem var(--font-display); letter-spacing: .04em; color: var(--oxblood); }
.tut-who span { font: .8rem var(--font-caps); letter-spacing: .05em; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tut-icon {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(122,95,53,.5); background: rgba(255,250,235,.45);
  color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0;
}
.tut-icon:hover { background: rgba(255,250,235,.8); }
.tut-bar { list-style: none; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 0; margin: 10px 0 4px; }
.tut-bar li { position: relative; height: 6px; border-radius: 3px; background: rgba(122,95,53,.25); overflow: hidden; }
.tut-bar li.is-done { background: var(--forest); }
.tut-bar li i { position: absolute; inset: 0 auto 0 0; width: var(--f, 0%); background: var(--oxblood-hi); transition: width .3s var(--ease); }
.tut-bar li.is-now { box-shadow: 0 0 0 1px var(--oxblood); }
.tut-text p { margin: .45em 0 .2em; color: var(--ink); }
.tut-text b { color: var(--oxblood); font-weight: 600; }
.tut-prog { font: .85rem var(--font-caps); letter-spacing: .06em; color: var(--forest) !important; }
.tut-done-k { font: 600 .85rem var(--font-caps); letter-spacing: .1em; text-transform: uppercase; color: var(--forest) !important; }
.tut-nudge { margin: .4em 0 0; padding: .35em .6em; border-radius: 6px; font-size: .92rem; background: rgba(165,68,58,.12); border-left: 3px solid var(--oxblood-hi); color: var(--ink); animation: tut-shake .42s ease both; }
.tut-nudge--good { background: rgba(63,125,78,.14); border-left-color: var(--forest); }
@keyframes tut-shake { 0% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } 100% { transform: none; } }
.tut-doit { display: flex; align-items: center; gap: 8px; margin: .5em 0 0; font: .84rem var(--font-caps); letter-spacing: .06em; color: var(--ink-soft); }
.tut-doit-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.28); animation: tut-pulse 1.4s ease-in-out infinite; }
.tut-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(122,95,53,.35); border-top-color: var(--oxblood); animation: tut-spin .9s linear infinite; }
@keyframes tut-spin { to { transform: rotate(360deg); } }
.tut-acts { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tut-acts .btn { min-height: 36px; }
.tut-sp { flex: 1; }
.tut-card .btn--ghost { color: var(--ink); }
.tut-next { min-width: 92px; }

/* modals: chapter menu, final, exit confirm */
.tut-modal-back { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(10,6,3,.55); backdrop-filter: blur(1.5px); pointer-events: auto; animation: fade-in .2s both; }
.tut-modal-back--top { z-index: 2; }
.tut-modal { width: min(620px, 100%); max-height: calc(100dvh - 32px); overflow: auto; animation: rise-in .28s var(--ease) both; position: relative; }
.tut-modal h2 { color: var(--ink); margin: 0 0 .2em; font-size: 1.45rem; }
.tut-kicker { margin: 0; font: .8rem var(--font-caps); letter-spacing: .14em; text-transform: uppercase; color: var(--oxblood); }
.tut-menu-head { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-bottom: 8px; }
.tut-menu-sub { margin: 0; color: var(--ink-soft); font-size: .98rem; }
.tut-chapters { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 6px; }
.tut-ch {
  width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(122,95,53,.35); background: rgba(255,250,235,.38); color: var(--ink);
  transition: background .15s, transform .12s var(--ease);
}
.tut-ch:hover { background: rgba(255,250,235,.75); transform: translateX(2px); }
.tut-ch.is-next { border-color: var(--oxblood-hi); box-shadow: inset 3px 0 0 var(--oxblood-hi); background: rgba(255,250,235,.7); }
.tut-ch-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--brass-lo); background: rgba(176,141,87,.25); font-weight: 600; }
.tut-ch.is-done .tut-ch-n { background: var(--forest); color: var(--parchment-hi); border-color: #2c4a2b; }
.tut-ch-t { display: grid; line-height: 1.2; }
.tut-ch-t b { font: 600 1rem var(--font-display); letter-spacing: .03em; }
.tut-ch-t small { font-size: .9rem; color: var(--ink-soft); }
.tut-ch-m { font-size: .85rem; color: var(--ink-faint); }
.tut-menu-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.tut-modal .btn--ghost { color: var(--ink); }
.tut-confirm { width: min(440px, 100%); }
.tut-confirm p { color: var(--ink-soft); }
.tut-final { text-align: center; width: min(520px, 100%); }
.tut-final-seal { width: 84px; height: 84px; margin: -4px auto 4px; display: block; filter: drop-shadow(0 3px 5px rgba(0,0,0,.4)); }
.tut-final p { color: var(--ink); }
.tut-final b { color: var(--oxblood); }
.tut-sign { font-style: italic; color: var(--ink-soft) !important; margin-top: -.2em; }
.tut-final-acts { display: grid; gap: 8px; margin: 14px auto 6px; max-width: 340px; }
.tut-final-menu { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; margin-top: 6px; font-size: .95rem; }
.tut-fail { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px)); }

@media (max-width: 720px) {
  .tut-card { width: calc(100vw - 20px); padding: 10px 12px; font-size: .95rem; }
  .tut-face { width: 42px; height: 42px; }
  .tut-head { gap: 8px; }
  .tut-bar { margin: 8px 0 2px; }
  .tut-text p { margin: .35em 0 .15em; }
  .tut-acts { margin-top: 8px; gap: 4px; }
  .tut-acts .btn { min-height: 34px; padding: .15em .6em; font-size: .82rem; }
  .tut-menu-head { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .tut-modal h2 { font-size: 1.25rem; }
  .tut-ch { padding: 7px 8px; }
  .tut-ch-t small { font-size: .84rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tut-hole, .tut-card { transition: none; }
  .tut-hole::after, .tut-ptr svg, .tut-doit-mark, .tut-nudge { animation: none; }
}
