/* ===== チュートリアルオーバーレイ（v3 / body直下 position:fixed） ===== */

#tutorial-overlay {
  position: fixed;
  inset: 0;
  height: 100dvh;            /* iOSのアドレスバー伸縮に追従 */
  z-index: 9000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: auto;
}
#tutorial-overlay[hidden] { display: none; }

/* スポットライト：巨大 box-shadow で穴の外側を暗くする */
#tut-spotlight {
  position: absolute;
  border-radius: 10px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,0.66);
  border: 2px solid rgba(255,193,7,0.85);
  pointer-events: none;
  z-index: 1;
  transition: top .35s, left .35s, width .35s, height .35s;
}
/* 穴なし＝全面暗転モード */
#tut-spotlight.no-hole {
  inset: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: rgba(0,0,0,0.6);
}

/* キャラクターエリア */
.tut-chars {
  position: absolute;
  bottom: 124px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 3;
}

.tut-char {
  width: 42%;
  max-width: 180px;
  transition: filter 0.3s, opacity 0.3s;
}

.tut-char img {
  width: 100%;
  max-height: 52vw;
  object-fit: contain;
  display: block;
}

/* 右（イチカ豚）— 向きを反転して左を向かせる（transform-origin はデフォルト中心のまま） */
#tut-char-right { transform: scaleX(-1); }

/* 非話者：暗く */
.tut-char-inactive {
  filter: brightness(0.6) saturate(0.4);
  opacity: 0.8;
}

/* ダイアログボックス */
.tut-dialogue {
  position: relative;
  z-index: 4;
  background: rgba(8, 18, 38, 0.94);
  border-top: 2.5px solid #FFC107;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  min-height: 108px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tut-speaker {
  font-size: 11px;
  font-weight: 700;
  color: #FFC107;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.tut-text {
  font-size: 13.5px;
  color: #f0f4ff;
  line-height: 1.65;
  min-height: 44px;
}

.tut-tap-hint {
  position: absolute;
  right: 14px;
  bottom: 6px;
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.04em;
}

.tut-step-count {
  position: absolute;
  left: 14px;
  bottom: 7px;
  font-size: 10px;
  color: rgba(255,255,255,0.28);
}

/* スキップボタン */
#tutorial-skip {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  right: 8px;
  z-index: 5;
  background: rgba(0,0,0,0.52);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.8);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#tutorial-skip:active { opacity: 0.6; }

/* ===== チュートリアル終了トースト ===== */
#tut-end-toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,40,60,0.92);
  border: 1px solid rgba(255,193,7,0.5);
  color: #f0f4ff;
  font-size: 12px;
  padding: 8px 18px;
  border-radius: 20px;
  z-index: 8999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}
#tut-end-toast.show { opacity: 1; }

/* ===== ライブラリ：チュートリアルカード ===== */

.tutorial-category {
  margin-bottom: 8px;
}

.tutorial-category-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted, #999);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 14px 4px;
}

.tutorial-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  background: #fff;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.tutorial-card:active { background: #f5f8ff; }

.tutorial-card-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.tutorial-card-body {
  flex: 1;
  min-width: 0;
}

.tutorial-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a2e5a;
  margin-bottom: 2px;
}

.tutorial-card-meta {
  font-size: 11px;
  color: var(--color-text-muted, #999);
}

.tutorial-card-arrow {
  font-size: 18px;
  color: #ccc;
  flex-shrink: 0;
}
