body {
      font-family: sans-serif;
      display: grid;
      place-items: center;
      min-height: 100vh;
      margin: 0;
      background: #f0f0f0;
    }
    .app {
      width: min(100%, 960px);
      display: grid;
      gap: 12px;
    }

    #viewer {
      position: relative;
      width: 100%;
      max-width: 640px;   /* 最大幅 */
      max-height: 480px;  /* 最大高さ */
      margin: 0 auto;
      background: #000;
      border: 2px solid #222;
      border-radius: 10px;
      overflow: hidden;
      aspect-ratio: 4 / 3; /* デフォルトは横画面寄り */
    }
    @media (orientation: portrait) {
      #viewer {
        max-width: 360px;
        max-height: 480px;
        aspect-ratio: 3 / 4; /* 縦画面寄り */
      }
    }

    #viewer > video,
    #viewer > img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      transform-origin: center center; /* ズーム・反転の基準 */
    }
    #captured-image {
      display: none;
    }

    #controls {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 12px;
    }

    button,
    input[type="range"] {
      font-size: 16px;
      border-radius: 8px;
      border: none;
      padding: 10px 16px;
    }
    button {
      background: #0a66ff;
      color: #fff;
      cursor: pointer;
      transition: background 0.2s ease;
    }
    button:hover {
      background: #0056cc;
    }
    button:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    /* やり直すボタンはグレー */
    button.retake {
      background: #e9ecef;
      color: #111;
    }
    button.retake:hover {
      background: #d6d8db;
    }

    input[type="range"] {
      width: min(300px, 60vw);
      accent-color: #0a66ff;
      background: #fff;
      border: 1px solid #ddd;
      padding: 6px;
      height: 40px;
    }

    /* ページ全体のリンクから下線を消す */
    a {
      text-decoration: none;
    }

    /* ▼ フッターの文字色を青へ */
    footer {
      text-align: center;
      padding: 10px 0 20px;
      font-size: 0.95rem;
      color: #1565c0;
    }

    footer a {
      color: #1565c0;
      text-decoration: none;
      font-weight: bold;
    }

    footer a:hover {
      color: #0d47a1;
    }

/* ===== 共通固定フッター ===== */
:root {
  --sakurayama-footer-height: 56px;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--sakurayama-footer-height) + 14px) !important;
  box-sizing: border-box;
}

.site-footer {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2147483000 !important;
  width: 100% !important;
  min-height: var(--sakurayama-footer-height) !important;
  margin: 0 !important;
  padding: 6px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  text-align: center !important;
  background: rgba(248, 251, 255, 0.97) !important;
  border-top: 1px solid rgba(21, 101, 192, 0.28) !important;
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.10) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.site-footer .sakurayama-copyright {
  margin: 0 !important;
  color: #1565c0 !important;
  font-size: 1.02rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

.site-footer .sakurayama-copyright a {
  color: #1565c0 !important;
  text-decoration: none !important;
  font-weight: 700 !important;
}

.site-footer .sakurayama-copyright a:hover,
.site-footer .sakurayama-copyright a:focus-visible {
  color: #0d47a1 !important;
  text-decoration: underline !important;
}

@media (max-width: 480px) {
  :root {
    --sakurayama-footer-height: 52px;
  }
  .site-footer .sakurayama-copyright {
    font-size: 0.94rem !important;
  }
}

@media print {
  body {
    padding-bottom: 0 !important;
  }
  .site-footer {
    display: none !important;
  }
}

/* HTMLから外部化した要素別スタイル */
.html-style-001 { display:none; }
.html-style-002 { display:none; }
.html-style-003 { display:none; }
.html-style-004 { display:none; }
.html-style-005 { display:none; }
.html-style-006 { display:none; }
.html-style-007 { display:none; }
