/* ─────────────────────────────────────────────────────────────
   Shared tutorial engine styles
   Used by player.html and index.html
   ───────────────────────────────────────────────────────────── */
:root {
  --bg:#0a0a0a; --card:#141414; --card2:#1a1a1a;
  --border:#262626; --text:#f5f5f5; --muted:#a3a3a3;
  --accent:#7c3aed; --accent2:#6d28d9;
  --g:#22c55e; --y:#eab308; --r:#ef4444;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif; min-height: 100vh;
}
code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 4px; font-size: 90%; }

/* Layout shells */
.wrap {
  max-width: 1200px; margin: 0 auto; padding: 20px;
  display: flex; flex-direction: column; gap: 14px; min-height: 100vh;
}
.hdr {
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border); padding-bottom: 10px;
}
.hdr h1 { margin: 0; font-size: 18px; font-weight: 800; }
.hdr .meta { font-size: 11.5px; color: var(--muted); }
.hint { font-size: 11.5px; color: var(--muted); }

/* ── Chips / toggles ─────────────────────────────────────── */
.chapter {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
}
.chip {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 14px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; user-select: none;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:hover { color: var(--text); }
.switch {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.switch input { accent-color: var(--accent); }

/* ── Player stage ─────────────────────────────────────────── */
.stage {
  position: relative; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; flex: 1; display: flex; flex-direction: column;
}
.frame {
  position: relative; flex: 1; display: flex;
  align-items: center; justify-content: center;
  min-height: 420px; background: #000;
}
.frame img {
  max-width: 100%; max-height: 62vh;
  object-fit: contain; display: block;
  transition: opacity .55s ease;
}
.frame.between img { opacity: .25; }
.frame.between .callout, .frame.between .tooltip { opacity: 0; }
.callout {
  position: absolute; background: rgba(124,58,237,.18);
  border: 2px solid var(--accent); border-radius: 8px;
  pointer-events: none; transition: all .35s;
}
.tooltip {
  position: absolute; background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 6px;
  box-shadow: 0 6px 18px rgba(124,58,237,.45);
  transition: all .35s; pointer-events: none;
}

.caption {
  padding: 14px 18px; font-size: 14px; line-height: 1.55;
  border-top: 1px solid var(--border); background: #0d0d0d; min-height: 90px;
}
.scene-no {
  font-size: 10.5px; font-weight: 800; color: var(--accent);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px;
}

/* ── Case study splash ───────────────────────────────────── */
.case-study {
  background: linear-gradient(135deg, #1a1033 0%, #0d0820 100%);
  border: 1px solid rgba(124,58,237,.4);
  border-radius: 14px; padding: 32px;
  display: flex; flex-direction: column; gap: 16px;
}
.case-study .cs-tag {
  display: inline-block; font-size: 10.5px; font-weight: 800;
  background: rgba(124,58,237,.2); color: #c4b5fd;
  padding: 4px 10px; border-radius: 12px;
  letter-spacing: .5px; text-transform: uppercase;
  align-self: flex-start;
}
.case-study h2 {
  font-size: 22px; font-weight: 800; margin: 0; line-height: 1.25;
}
.case-study .cs-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 12.5px; color: var(--muted);
}
.case-study .cs-meta span {
  display: inline-flex; align-items: center; gap: 4px;
}
.case-study .cs-block {
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.case-study .cs-block .cs-lbl {
  font-size: 10px; font-weight: 800; color: #c4b5fd;
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px;
}
.case-study .cs-block .cs-val {
  font-size: 14px; line-height: 1.55;
}
.case-study ul.cs-skills {
  margin: 6px 0 0 18px; padding: 0;
  font-size: 13.5px; line-height: 1.6;
}
.case-study ul.cs-skills li { margin-bottom: 2px; }
.case-study .cs-start {
  background: var(--accent); color: #fff; border: none;
  font-size: 15px; font-weight: 800; padding: 14px 22px;
  border-radius: 10px; cursor: pointer;
  align-self: flex-start; margin-top: 4px;
}
.case-study .cs-start:hover { background: var(--accent2); }

/* ── Controls ─────────────────────────────────────────────── */
.controls {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px;
}
.controls button {
  background: rgba(255,255,255,.08); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 700;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.controls button.primary { background: var(--accent); border-color: var(--accent); }
.controls button:disabled { opacity: .4; cursor: default; }
.progress {
  flex: 1; height: 6px; background: rgba(255,255,255,.06);
  border-radius: 3px; overflow: hidden; margin: 0 4px;
}
.progress > div {
  height: 100%; background: var(--accent);
  transition: width .4s linear;
}

/* ── Fullscreen ───────────────────────────────────────────── */
body:fullscreen .wrap { max-width: 100vw; padding: 14px; }
body:fullscreen .stage .frame img { max-height: 78vh; }
body:fullscreen .hdr,
body:fullscreen .chapter,
body:fullscreen .hint { display: none; }

@media (max-width:760px) {
  .frame img { max-height: 54vh; }
  .hdr h1 { font-size: 15px; }
  .case-study { padding: 20px; }
  .case-study h2 { font-size: 18px; }
}

/* ─────────────────────────────────────────────────────────────
   Index page (catalog) styles
   ───────────────────────────────────────────────────────────── */
.idx-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.idx-section h2 {
  margin: 0 0 4px; font-size: 17px; font-weight: 800;
}
.idx-section .idx-sub {
  font-size: 12.5px; color: var(--muted); margin-bottom: 14px;
}
.idx-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.idx-card {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; text-decoration: none;
  color: var(--text); display: flex; flex-direction: column; gap: 6px;
  transition: border-color .18s, transform .18s;
}
.idx-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.idx-card .idx-chip {
  display: inline-block; font-size: 9.5px; font-weight: 800;
  padding: 2px 8px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: .3px;
  align-self: flex-start; background: rgba(124,58,237,.18); color: #c4b5fd;
}
.idx-card .idx-chip.supervisor { background: rgba(34,197,94,.16); color: #86efac; }
.idx-card .idx-chip.client     { background: rgba(236,72,153,.16); color: #f9a8d4; }
.idx-card .idx-chip.agent      { background: rgba(125,211,252,.18); color: #7dd3fc; }
.idx-card .idx-title {
  font-size: 14.5px; font-weight: 800; line-height: 1.3; margin-top: 2px;
}
.idx-card .idx-summary {
  font-size: 12px; color: var(--muted); line-height: 1.5; flex: 1;
}
.idx-card .idx-foot {
  font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px;
}
.idx-card .idx-foot .pill {
  background: rgba(255,255,255,.08); padding: 2px 8px;
  border-radius: 8px; font-weight: 700;
}
.idx-coming {
  opacity: .55; pointer-events: none; cursor: default;
}
.idx-coming .idx-foot::after { content: '· coming soon'; color: var(--y); margin-left: auto; }
