/**
 * @file www/css/components/offset-cursor.css
 * @description オフセットカーソルのスタイル定義
 * @created 2025-11-26
 * @updated 2025-11-27 Pixel Square Design
 */

/* カーソルレイヤー（タッチイベントを透過） */
#cursor-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-index-cursor);
  overflow: hidden;
}

/* ガイド線（指と描画位置を結ぶ線） */
.cursor-guide-line {
  position: absolute;
  width: 2px;
  background-color: var(
    --kaku-accent-primary,
    #000000
  ); /* JSでペン色に上書きされるが、規定のデフォルトを黒に */
  transform-origin: top center;
  pointer-events: none;
  display: none;
  z-index: 9998;
  opacity: 0.6; /* 少し薄くして主役（カーソル）を邪魔しない */
}

/* =========================================
   デザイン案1: 【推奨】ピクセル・スクエア
   特徴: 正方形、白いフチ取り、スナップ感
   ========================================= */
.cursor-target {
  position: absolute;
  width: 14px;
  height: 14px;
  /* 正方形（わずかに角を丸めて馴染ませる） */
  border-radius: 1px;

  /* メインカラー（JSでborderColorが上書きされる） */
  border: 2px solid var(--kaku-accent-primary, #000000);

  /* 白いフチ取りで視認性確保 + ドロップシャドウ */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 2px 5px rgba(0, 0, 0, 0.3);

  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
  z-index: 9999;

  /* 内部は薄く色づけ */
  background-color: rgba(255, 255, 255, 0.1);

  transition: opacity 0.1s ease,
    transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* バウンス効果 */
}

/* 中心点（スクエアの場合は不要、または極小にする） */
.cursor-center-point {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
}

/* 描画中のフィードバック（キュッと締まる） */
.cursor-target.drawing {
  transform: translate(-50%, -50%) scale(0.8);
  border-width: 3px; /* 枠を太く */
  background-color: rgba(255, 255, 255, 0.3); /* 内部を少し濃く */
}

/* =========================================
   デザイン案2: プレシジョン・クロス（コメントアウト中）
   特徴: 十字線、精密射撃
   ========================================= */
/*
.cursor-target {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 1px solid var(--kaku-accent-primary, #000000); 
  border-radius: 50%; 
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
  transform: translate(-50%, -50%);
  display: none;
  z-index: 9999;
}
.cursor-target::before, .cursor-target::after {
  content: '';
  position: absolute;
  background-color: var(--kaku-accent-primary, #000000); 
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.cursor-target::before { width: 100%; height: 1px; }
.cursor-target::after { width: 1px; height: 100%; }
*/

/* =========================================
   デザイン案3: バーチャル・ペン（コメントアウト中）
   特徴: ペン先形状
   ========================================= */
/*
.cursor-target {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 16px solid var(--kaku-accent-primary, #000000); 
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
  transform: translate(-50%, -50%) rotate(-45deg); 
  transform-origin: center bottom; 
  display: none;
  z-index: 9999;
}
*/

/* アクティブ時の表示 */
.offset-cursor-active .cursor-guide-line,
.offset-cursor-active .cursor-target {
  display: block;
}

/* ペン操作時などは非表示にするクラス */
.cursor-hidden .cursor-guide-line,
.cursor-hidden .cursor-target {
  opacity: 0;
}
