/* ============================================================
 * spine-viewer.css — スパインビューアー（スマホ最優先・閲覧専用）
 * ============================================================ */

#content-spine-viewer { padding: 0; }

.sv-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 12px 18px;
}

/* ---- コントロール（プルダウン）: 詰めてアニメ表示領域を広く ---- */
.sv-controls {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 9px;
}
.sv-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #8a8f9c;
  margin: 0 0 3px 2px;
  letter-spacing: .2px;
}
.sv-select {
  position: relative;
}
.sv-select::after {
  content: "\f078"; /* fa chevron-down */
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif;
  font-weight: 900;
  font-size: 12px;
  color: #fd79a8;
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.sv-select select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 11px 38px 11px 14px;   /* やや詰める（タップ性は維持） */
  font-size: 16px;                /* iOSで自動ズームしない最小サイズ */
  font-weight: 600;
  color: #2b2f3a;
  background: #fff;
  border: 1.5px solid #e7e9f0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(20,20,50,.04);
  cursor: pointer;
}
.sv-select select:focus {
  outline: none;
  border-color: #fd79a8;
  box-shadow: 0 0 0 3px rgba(253,121,168,.15);
}

/* ---- ステージ（白背景・アニメ表示） ---- */
.sv-stage {
  position: relative;
  width: 100%;
  height: 68vh;
  min-height: 380px;
  background: #ffffff;
  border: 1.5px solid #e7e9f0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(30,30,70,.06);
}
.sv-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;            /* ピンチ/ドラッグでページが動かないように */
}

/* 全画面ボタン（白背景でも必ず見えるよう高コントラストのピンク） */
.sv-fs {
  position: absolute;
  top: 10px; right: 10px;
  height: 44px;
  padding: 0 14px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #fd79a8;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(253,121,168,.45);
  z-index: 5;
}
.sv-fs:active { transform: scale(.94); }
/* 全画面中は「閉じる」ラベル付きでさらに目立たせ、ノッチを避けて配置 */
.sv-stage.sv-fullscreen .sv-fs {
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: calc(env(safe-area-inset-right, 0px) + 12px);
  height: 48px;
  font-size: 15px;
}
.sv-stage.sv-fullscreen .sv-fs::after { content: "閉じる"; }

/* ローディング表示 */
.sv-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #8a8f9c;
  font-size: 14px;
  background: rgba(255,255,255,.85);
  z-index: 2;
}

/* ---- 全画面モード（CSS。iOSでも確実に動く） ---- */
.sv-stage.sv-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;                /* モバイルのアドレスバー考慮 */
  border-radius: 0;
  border: none;
  z-index: 2147483000;
  box-shadow: none;
}
body.sv-fs-lock { overflow: hidden; }

/* ---- 速度スライダー ---- */
.sv-speedrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: #fff;
  border: 1.5px solid #e7e9f0;
  border-radius: 14px;
}
.sv-speed-label {
  font-size: 13px; font-weight: 700; color: #8a8f9c; white-space: nowrap;
}
.sv-speed-label i { color: #fd79a8; margin-right: 2px; }
#sv-speed {
  -webkit-appearance: none; appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #eef0f6;
  outline: none;
}
#sv-speed::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fd79a8;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(253,121,168,.5);
  cursor: pointer;
}
#sv-speed::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fd79a8; border: 3px solid #fff; cursor: pointer;
}
#sv-speedval {
  font-size: 13px; font-weight: 700; color: #2b2f3a;
  min-width: 48px; text-align: right; font-variant-numeric: tabular-nums;
}

.sv-note {
  margin: 12px 2px 0;
  font-size: 12px;
  color: #aab0bd;
  text-align: center;
  line-height: 1.6;
}

/* ---- デスクトップ調整 ---- */
@media (min-width: 720px) {
  .sv-controls { flex-direction: row; }
  .sv-field { flex: 1; }
  .sv-stage { height: 70vh; }
}
