/*
 * congruence-shape-checker.css
 * 「図形となかよし！合同さがし」スタイル
 * Version: 2.0.0（ヘッダー＋フルスクリーン＋右下ツールバーのシンプルUIに変更。
 *   じゆう作図で合同さがし！ と同じスケルトンに統一）
 * すべてのセレクタは .csc- プレフィックスでスコープ化しています。
 * WordPressのCSSとの干渉を防ぐため、html/bodyへの指定は body:has(.csc-root) 等で
 * このアプリのページにのみ限定しています（グローバルな上書きは行いません）。
 */

.csc-root,
.csc-root * {
  box-sizing: border-box;
}

/* 修正: 画面下の空白対策。html/bodyを100%化し、ページ側の背景が
   見えないようにする（:has()はこのアプリが使われているページにのみ適用） */
html:has(.csc-root),
body:has(.csc-root) {
  height: 100%;
  margin: 0;
}

/* 修正: シンプルUI化。ヘッダー＋フルスクリーンstage＋右下ツールバーの
   固定レイアウトに変更（他アプリと共通のスケルトン）。 */
.csc-root {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "BIZ UDGothic", "M PLUS Rounded 1c", "Hiragino Maru Gothic Pro", sans-serif;
  background: #eef4fb;
  color: #1e3a5f;
  -webkit-tap-highlight-color: transparent;
  z-index: 9999;
}

/* ===== ヘッダー ===== */
.csc-root .csc-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: #1e3a5f;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 20;
}
.csc-root .csc-header h1 {
  font-size: 15px;
  font-weight: bold;
  margin: 0;
  white-space: nowrap;
}
.csc-root .csc-hint {
  flex: 1;
  font-size: 13px;
  font-weight: bold;
  color: #1e3a5f;
  background: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* ===== フルスクリーンstage ===== */
.csc-root .csc-stage-wrap {
  position: fixed;
  top: 52px; left: 0;
  width: 100vw;
  height: calc(100vh - 52px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.csc-root .csc-stage-inner {
  position: relative;
  width: min(100%, calc((100vh - 52px - 24px) * 1000 / 560));
  aspect-ratio: 1000 / 560;
  max-width: 1300px;
  max-height: 100%;
  background: #ffffff;
  border-radius: 16px;
  border: 3px solid #1e3a5f;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  touch-action: none;
}
.csc-root .csc-stage {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.csc-shape-group {
  cursor: grab;
}
.csc-shape-group:active {
  cursor: grabbing;
}
.csc-label-text {
  font-size: 30px;
  font-weight: bold;
  fill: #1e3a5f;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

/* ===== 右下：ツールバーの縦積みコンテナ ===== */
.csc-root .csc-toolbar-area {
  position: fixed;
  right: 16px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 10;
}
.csc-root .csc-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.csc-root .csc-btn {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 2px solid #dde4ef;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s;
  background: #ffffff;
  color: #1e3a5f;
}
.csc-root .csc-btn:active         { transform: scale(0.92); }
.csc-root .csc-btn:disabled       { opacity: 0.35; cursor: default; }
.csc-root .csc-btn:disabled:active { transform: none; }
.csc-root .csc-btn-gold { background: #d4af37; border-color: #d4af37; color: #fff; }

/* セット切り替えボタン（1/2/3） */
.csc-root .csc-set-btn { font-size: 18px; }
.csc-root .csc-set-btn.csc-set-active {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #fff;
}

@media (max-width: 480px) {
  .csc-root .csc-header h1 { font-size: 13px; }
  .csc-root .csc-btn { width: 48px; height: 48px; font-size: 18px; }
  .csc-root .csc-toolbar-area { right: 10px; bottom: 14px; }
}
