/* くりぬきカメラ - スタイル
 * すべて .kuri-root 配下にスコープし、テーマ干渉を防ぐ
 * フロートバー(.kuri-floatbar)は position:fixed のため body 直下扱いだが
 * クラス名で限定しているため他要素には影響しない
 */

.kuri-root {
  margin: 0;
  font-family: "BIZ UDPGothic", "M PLUS Rounded 1c", sans-serif;
  background: #f3f6fb;
  text-align: center;
  color: #1e3a5f;
  padding-bottom: 110px; /* 下部フロートバーと内容が重ならないよう余白確保 */
}
.kuri-root h1 { margin: 12px; font-size: 24px; }

.kuri-root .kuri-tools { margin: 12px; }
.kuri-root .kuri-tools button {
  font-size: 18px;
  padding: 10px 16px;
  margin: 4px;
  border-radius: 10px;
  border: 2px solid #1e3a5f;
  background: #fff;
  color: #1e3a5f;
  cursor: pointer;
}
.kuri-root .kuri-tools button.kuri-active {
  background: #1e3a5f;
  color: #fff;
}
.kuri-root .kuri-tools button.kuri-cam {
  border-color: #b8941f;
  color: #b8941f;
}
.kuri-root .kuri-tools button.kuri-cam.kuri-on {
  background: #d4af37;
  color: #fff;
  border-color: #b8941f;
}

.kuri-root .kuri-wrap {
  position: relative;
  width: 90vw;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  margin: auto;
  background: #fff;
  border: 4px solid #1e3a5f;
  overflow: hidden;
}

/* 透明部分を表す市松模様レイヤー（最下層）。標準グレー2色 */
.kuri-root .kuri-checker {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #e8e8e8 25%, transparent 25%),
    linear-gradient(-45deg, #e8e8e8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8e8e8 75%),
    linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.kuri-root .kuri-wrap video,
.kuri-root .kuri-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.kuri-root .kuri-wrap video {
  object-fit: cover;
  z-index: 1;            /* 市松模様の上、絵の下 */
  background: transparent;
}
.kuri-root .kuri-draw {
  z-index: 2;            /* 一番上：白い紙＋絵＋くりぬき */
  touch-action: none;
}
.kuri-root .kuri-hint {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #9aa7b8;
  font-size: 20px;
}
.kuri-root .kuri-hint.kuri-hidden { display: none; }

/* ===== 画面下フロートバー（色・太さ） ===== */
.kuri-floatbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  background: rgba(255, 255, 255, 0.96);
  border-top: 3px solid #1e3a5f;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
  font-family: "BIZ UDPGothic", "M PLUS Rounded 1c", sans-serif;
  color: #1e3a5f;
}
.kuri-floatbar .kuri-optgroup {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.kuri-floatbar .kuri-label {
  font-size: 15px;
  font-weight: bold;
}
.kuri-floatbar .kuri-color {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid #ccc;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.kuri-floatbar .kuri-color.kuri-active {
  border-color: #1e3a5f;
  transform: scale(1.15);
}
.kuri-floatbar .kuri-size {
  font-size: 14px;
  padding: 6px 10px;
  margin: 2px;
  border-radius: 8px;
  border: 2px solid #aaa;
  background: #fff;
  color: #333;
  cursor: pointer;
}
.kuri-floatbar .kuri-size.kuri-active {
  border-color: #1e3a5f;
  background: #1e3a5f;
  color: #fff;
}
.kuri-floatbar .kuri-sizeset {
  display: none;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.kuri-floatbar .kuri-sizeset.kuri-show { display: flex; }

@media (max-width: 600px) {
  .kuri-floatbar { gap: 8px; padding: 6px 8px; }
  .kuri-floatbar .kuri-size { font-size: 13px; padding: 5px 8px; }
  .kuri-floatbar .kuri-color { width: 28px; height: 28px; }
  .kuri-root { padding-bottom: 130px; }
}
