@charset "utf-8";

/* =========================================================
   LIBRO＋CRAFT 体験版
   見た目は本体（LIBRO_CRAFT/app）の編集画面に似せる。値は本体の画面を見て合わせたもので、
   本体の CSS を写したものではない。紙面上の仕掛けの座標は demo.js が % で指定する。
   ========================================================= */

/* 見た目を合わせた本体のコミット：LIBRO_CRAFT a1a0277（2026-10-30）。docs/体験版_計画書.md 10章 */
:root {
  --chrome:      #353c47;   /* ヘッダー・左のアイコンレール（本体のアプリクロム） */
  --chrome-ink:  #c9d2dc;   /* レール・切替の文字とアイコン */
  --stage:       #515661;   /* 紙面の周り（本体は点の模様つき） */
  --ink:         #333333;
  --accent:      #4a88d8;   /* 描画中の項目・今のモードの札 */
  --sel:         #4f80ff;   /* 選択中の仕掛けの線とハンドル */
  --draw:        #4488ff;   /* ドラッグ中の配置プレビュー */
  --field-bg:    #2a3040;   /* 詳細設定の入力欄 */
  --field-line:  #4a5468;
  --field-ink:   #dddde8;
  --notice-bg:   #fff6d6;
  --notice-ink:  #5a4500;
  --font: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--stage);
  overscroll-behavior: none;
}
h2, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid #ffb84d;
  outline-offset: 2px;
}

/* ---------- 画面の骨組み ---------- */
.app {
  height: 100vh;
  display: flex; flex-direction: column;
  user-select: none; -webkit-user-select: none;
}

/* ---------- ヘッダー（本体と同じく高さ 38px） ---------- */
/* 左に本体と同じブロック、右端に「特設サイトへ戻る」 */
.nav {
  flex: none; position: relative; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  height: 38px; padding-right: 10px;
  background: var(--chrome); color: #fff;
}
.nav__left { display: flex; align-items: center; height: 38px; white-space: nowrap; }
.nav__blk {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  height: 100%; padding: 0 12px;
}
/* ブロックの区切り線（本体と同じく白 25%） */
.nav__blk::after {
  content: ''; position: absolute; right: 0; top: 8px;
  width: 1px; height: calc(100% - 16px);
  background: rgba(255,255,255,.25);
}
.nav__blk:first-child { padding-left: 14px; }
.nav__blk:last-child::after { display: none; }
/* ページ移動の5つは1つのまとまりに見せるため、間隔を半分（4px）にする（本体と同じ） */
.nav__blk--pages { gap: 4px; }
/* 詳細設定・整列は編集モードだけ（本体と同じ） */
.is-view-mode .nav__blk--edit { display: none; }

/* ヘッダーのボタン（34px 角。本体の .nav-btn と同じ） */
.nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: transparent; color: #fff; border: 0; border-radius: 5px;
  cursor: pointer;
  transition: background .15s;
}
.nav-btn:hover { background: rgba(255,255,255,.15); }
.nav-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.nav-btn svg { fill: currentColor; }
.nav-btn[aria-expanded="true"] { background: rgba(255,255,255,.15); }
.nav-btn__icon {
  width: 18px; height: 18px; background: currentColor;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat;
}
.nav-btn__icon--edit  { -webkit-mask-image: url(../assets/icons/edit.svg);         mask-image: url(../assets/icons/edit.svg); }
.nav-btn__icon--align { -webkit-mask-image: url(../assets/icons/align-header.svg); mask-image: url(../assets/icons/align-header.svg); }

/* マウスを乗せて 0.8 秒待つと出す名前（本体と同じ） */
.nav [data-tip] { position: relative; }
.nav [data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; left: 50%; top: calc(100% + 6px); z-index: 10;
  transform: translateX(-50%);
  padding: 4px 8px; border-radius: 4px;
  background: #222; color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap;
  pointer-events: none;
  opacity: 0; animation: tip-in .15s ease .8s forwards;
}
@keyframes tip-in { to { opacity: 1; } }

/* 編集／閲覧の切替：2つで1つ。今のモードの側へ青い札（::before）がすべって動く */
.mode-toggle {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 3px;
  background: rgba(0,0,0,.25); border: 0; border-radius: 8px;
  cursor: pointer;
}
.mode-toggle::before {
  content: ''; position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  background: var(--accent); border-radius: 6px;
  transition: transform .22s ease;
}
.is-view-mode .mode-toggle::before { transform: translateX(100%); }
.mode-toggle > span {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  height: 24px; padding: 0 10px;
  color: var(--chrome-ink);
  font-size: 12px; font-weight: 700; letter-spacing: -.02em;
  transition: color .22s ease;
}
.mode-toggle:hover > span,
.app:not(.is-view-mode) .mode-toggle__edit,
.is-view-mode .mode-toggle__view { color: #fff; }
.mode-toggle__icon {
  width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url(../assets/icons/edit.svg) center / contain no-repeat;
          mask: url(../assets/icons/edit.svg) center / contain no-repeat;
}
.mode-toggle__icon--view {
  -webkit-mask-image: url(../assets/icons/mode-switch.svg);
          mask-image: url(../assets/icons/mode-switch.svg);
}

/* ページ番号の入力と総ページ数（本体と同じ） */
.page-direct {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; color: #fff;
}
.page-direct__input {
  width: 40px; height: 26px; padding: 0;
  background: #fff; color: var(--chrome); border: 0; border-radius: 4px;
  font: inherit; font-size: 13px; font-weight: 700; text-align: center;
}
.page-direct__input:focus { outline: 2px solid #6898d8; }
.page-direct__total { min-width: 2.6em; }

/* フィットボタン（枠線あり。本体と同じ） */
.fit-btn {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  background: transparent; color: #fff;
  border: 1px solid #fff; border-radius: 3px;
  cursor: pointer;
  transition: background .15s;
}
.fit-btn:hover { background: rgba(255,255,255,.2); }
.fit-btn.is-selected { background: #fff; color: var(--chrome); }
.fit-btn__icon {
  background: currentColor;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat;
}
.fit-btn__icon--height { width: 8px; height: 14px; -webkit-mask-image: url(../assets/icons/fit-height.svg); mask-image: url(../assets/icons/fit-height.svg); }
.fit-btn__icon--width  { width: 14px; height: 8px; -webkit-mask-image: url(../assets/icons/fit-width.svg);  mask-image: url(../assets/icons/fit-width.svg); }

/* ---------- 詳細設定・整列：ヘッダーに収まらない幅ではアイコンから開くドロップダウン ---------- */
.hdr-inline {
  position: absolute; top: 100%; right: 0; z-index: 1;
  width: 260px; max-width: calc(100vw - 16px);
  padding: 12px;
  background: var(--chrome);
  border: 1px solid rgba(255,255,255,.15); border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  white-space: normal;
  user-select: auto; -webkit-user-select: auto;
}
.hdr-inline.is-closed { display: none; }
.hdr-inline.is-front { z-index: 2; }

/* 詳細設定の中身 */
.detail { display: grid; gap: 10px; font-size: 12px; font-weight: 700; }
.detail.is-empty { opacity: .35; pointer-events: none; }
.pos-row { display: flex; align-items: center; gap: 4px; }
.pos-row__label { flex: none; width: 14px; text-align: center; color: #fff; }
.pos-field { position: relative; flex: 1; min-width: 80px; display: flex; }
.pos-field::after {
  content: 'px'; position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: #888; pointer-events: none;
}
.spin-btns { display: flex; flex-direction: column; flex: none; width: 16px; height: 30px; }
.spin-btn {
  flex: 1; width: 16px; padding: 0;
  background: var(--field-bg); color: #8899bb;
  border: 1px solid var(--field-line); font-size: 7px; line-height: 1;
  cursor: pointer;
}
.spin-btn:first-child { border-radius: 4px 0 0 0; border-bottom: 0; }
.spin-btn:last-child  { border-radius: 0 0 0 4px; }
.spin-btn:hover { color: #fff; }
.d-input, .d-select {
  width: 100%; height: 30px; padding: 0 10px;
  background: var(--field-bg); color: var(--field-ink);
  border: 1px solid var(--field-line); border-radius: 4px;
  font: inherit; font-size: 12px; font-weight: 700;
}
.pos-field .d-input { padding-right: 22px; text-align: right; border-radius: 0 4px 4px 0; border-left: 0; }
.d-input:focus, .d-select:focus { outline: none; border-color: #6898d8; box-shadow: 0 0 0 2px rgba(104,152,216,.25); }
.d-input:disabled, .d-select:disabled { opacity: .5; }
.d-input::-webkit-inner-spin-button, .d-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.detail-sep {
  display: flex; align-items: center; gap: 8px;
  color: #9ab; font-size: 11px;
}
.detail-sep::before, .detail-sep::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.15); }
.detail-field__label { display: block; margin-bottom: 4px; color: #aab; }
.detail-radios { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--field-ink); }
.detail-radios label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.detail-hint { color: #9ab; font-weight: 400; }

/* 整列の中身 */
.align-panel { display: grid; gap: 6px; }
.align-row { display: flex; gap: 4px; }
.align-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  height: 30px; padding: 0;
  background: transparent; color: #9ab; border: 0; cursor: pointer;
  transition: color .12s;
}
.align-btn:hover { color: #cde; }
.align-btn:active { color: #6898d8; }
.align-panel.is-disabled .align-btn { opacity: .35; pointer-events: none; cursor: default; }
.align-btn__icon {
  width: 22px; height: 19px; background: currentColor;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat;
}
.align-btn__icon[data-icon="align-left"]    { -webkit-mask-image: url(../assets/icons/align-left.svg);    mask-image: url(../assets/icons/align-left.svg); }
.align-btn__icon[data-icon="align-centerH"] { -webkit-mask-image: url(../assets/icons/align-centerH.svg); mask-image: url(../assets/icons/align-centerH.svg); }
.align-btn__icon[data-icon="align-right"]   { -webkit-mask-image: url(../assets/icons/align-right.svg);   mask-image: url(../assets/icons/align-right.svg); }
.align-btn__icon[data-icon="distribute-h"]  { -webkit-mask-image: url(../assets/icons/distribute-h.svg);  mask-image: url(../assets/icons/distribute-h.svg); }
.align-btn__icon[data-icon="align-top"]     { -webkit-mask-image: url(../assets/icons/align-top.svg);     mask-image: url(../assets/icons/align-top.svg); }
.align-btn__icon[data-icon="align-centerV"] { -webkit-mask-image: url(../assets/icons/align-centerV.svg); mask-image: url(../assets/icons/align-centerV.svg); }
.align-btn__icon[data-icon="align-bottom"]  { -webkit-mask-image: url(../assets/icons/align-bottom.svg);  mask-image: url(../assets/icons/align-bottom.svg); }
.align-btn__icon[data-icon="distribute-v"]  { -webkit-mask-image: url(../assets/icons/distribute-v.svg);  mask-image: url(../assets/icons/distribute-v.svg); }

/* ヘッダーに収まる幅（全画面など）では、詳細設定・整列をまとめずにヘッダーへ直接並べる。
   収まるかどうかは demo.js が実際の幅で判定して .nav に .is-inline を付ける（一番広い「付箋を1件選択」で測る）。
   幅は確保しないので、整列は詳細設定のすぐ右に付く */
.nav.is-inline .nav-btn--acc { display: none; }
.nav.is-inline .hdr-inline, .nav.is-inline .hdr-inline.is-closed {
  position: static; display: flex; align-items: center;
  width: auto; max-width: none; height: 100%; padding: 0;
  background: none; border: 0; border-radius: 0; box-shadow: none;
}
.nav.is-inline .detail { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.nav.is-inline .pos-row { flex: none; }
.nav.is-inline .pos-field { flex: none; min-width: 0; }
.nav.is-inline .pos-field .d-input { width: 64px; }
.nav.is-inline .d-select { width: 84px; }
.nav.is-inline .detail-sep, .nav.is-inline .detail-field__label, .nav.is-inline .detail-hint { display: none; }
.nav.is-inline .detail-radios { flex-wrap: nowrap; gap: 10px; }
.nav.is-inline .align-panel { display: flex; gap: 12px; }

.nav__back {
  margin-left: auto; flex: none;
  color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap;
  height: 26px; display: inline-flex; align-items: center;
  padding: 0 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 6px;
  transition: background .15s;
}
.nav__back:hover { background: rgba(255,255,255,.15); }

/* ---------- 注意書き（ウィンドウ上部、ヘッダーのすぐ下の中央。常に表示） ----------
   文字に合わせた大きさの角丸の札。ほかの要素の上に重ねて置き、レイアウトの場所は取らない。
   下の紙面の操作を邪魔しないよう、マウスは通す。ヘッダー（高さ 38px）から 8px 離す。
   ヘッダーから開く詳細設定・整列のドロップダウンは、この札より手前に出る */
.notice-bar {
  position: fixed; left: 50%; top: 46px; z-index: 35;
  transform: translateX(-50%);
  pointer-events: none;
}
.notice {
  display: block; width: max-content; max-width: calc(100vw - 32px);
  padding: 5px 14px;
  background: var(--notice-bg); color: var(--notice-ink);
  border: 1px solid #e8d79a; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  font-size: 12px; font-weight: 700; line-height: 1.3; text-align: center;
}

/* 左のレールの上に 8px の隙間を空け、紙面と同じ地色を出す（本体と同じ） */
.workspace { flex: 1; min-height: 0; display: flex; background: var(--stage); }

/* ---------- 左：アイコンレール（幅 74px。本体と同じ） ---------- */
.side {
  flex: none; width: 74px;
  margin-top: 8px; padding: 8px 8px 12px;
  background: var(--chrome); color: var(--chrome-ink);
  border-radius: 0 12px 0 0;
  overflow-x: hidden; overflow-y: auto;
  transition: width .25s ease, opacity .2s ease, padding .25s ease;
}
/* 閲覧モード：幅を 0 へ縮め、薄くしながら隠す */
.is-view-mode .side { width: 0; padding-left: 0; padding-right: 0; opacity: 0; pointer-events: none; }

.rail { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rail-sep { border: 0; border-top: 1px solid rgba(255,255,255,.12); margin: 8px 4px; }
.tool {
  width: 58px; height: 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: transparent; color: var(--chrome-ink);
  border: 0; border-radius: 9px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tool:hover { background: rgba(255,255,255,.10); color: #fff; }
.tool:active { background: rgba(255,255,255,.16); }
/* 描画中（配置する仕掛けを選んでいる） */
.tool[aria-pressed="true"],
.tool[aria-pressed="true"]:hover { background: var(--accent); color: #fff; }
.tool__label { font-size: 11px; font-weight: 700; letter-spacing: -.04em; white-space: nowrap; }
.tool__icon {
  width: 20px; height: 22px; background: currentColor;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 20px 18px; mask-size: 20px 18px;
}
/* 付箋は LP のアイコン（本体スプライトから抽出したもの）を使い回す */
.tool__icon--sticky       { -webkit-mask-image: url(../../assets/icons/type-sticky.svg);       mask-image: url(../../assets/icons/type-sticky.svg); }
.tool__icon--daimon       { -webkit-mask-image: url(../assets/icons/daimon.svg);               mask-image: url(../assets/icons/daimon.svg); }
.tool__icon--group        { -webkit-mask-image: url(../assets/icons/sticky-group.svg);         mask-image: url(../assets/icons/sticky-group.svg); -webkit-mask-size: 20px 20px; mask-size: 20px 20px; }
.tool__icon--kotae        { -webkit-mask-image: url(../assets/icons/kotae.svg);                mask-image: url(../assets/icons/kotae.svg); }

/* ---------- 中央：紙面 ---------- */
/* .page の大きさ（フィットした基準サイズ）は demo.js が px で決める。拡大縮小は .page の scale、
   パンは .page-wrap の translate（本体と同じ）。はみ出した分は見切れる（Space＋ドラッグで動かして見る） */
.stage {
  position: relative;
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background-color: var(--stage);
  background-image: radial-gradient(circle, rgba(255,255,255,.06) 1.6px, transparent 1.6px);
  background-size: 38px 38px;
}
.page-wrap { flex: none; }
.page {
  position: relative;
  background: #fff;
  transform-origin: center center;
  --zoom-inv-scale: 1;
}
.page__img { display: block; width: 100%; height: 100%; pointer-events: none; }
.page__layer { position: absolute; inset: 0; }
.is-drawing .page__layer { cursor: crosshair; }
/* Space を押している間はパン（本体と同じ手のカーソル） */
.stage.is-space, .stage.is-space * { cursor: grab !important; }
.stage.is-panning, .stage.is-panning * { cursor: grabbing !important; }

/* ドラッグ中の配置プレビュー */
.draw-preview {
  position: absolute; pointer-events: none; z-index: 50;
  border: calc(2px * var(--zoom-inv-scale)) dashed var(--draw); background: rgba(68,136,255,.08);
}

/* ドラッグでの範囲選択の点線（画面の座標で描くので、紙面の外まで伸ばせる。本体と同じ黒の点線 1px） */
.marquee {
  position: fixed; z-index: 50; pointer-events: none;
  border: 1px dotted #333;
  background: transparent;
}

/* ---------- 紙面上の仕掛け（共通） ---------- */
.obj { position: absolute; }
.obj[hidden] { display: none; }
.app:not(.is-view-mode) .obj { cursor: move; }
.is-view-mode .obj { cursor: pointer; }
.is-drawing .obj { cursor: move; }

/* 選択の線とハンドル：仕掛けの外の重ね要素に描く（半透明の影響を受けない）。
   線は外形に青 1px。拡大縮小しても画面上で同じ太さ・大きさに見えるよう --zoom-inv-scale で打ち消す */
.sel-frame {
  position: absolute; z-index: 45; pointer-events: none;
  outline: calc(1px * var(--zoom-inv-scale)) solid var(--sel);
}

/* 付箋グループの枠：グループごとの色で 1px、付箋の内側に描く（選択の線は外側なので重ならない）。編集モードだけ */
.grp-frame {
  position: absolute; z-index: 44; pointer-events: none;
  border: calc(1px * var(--zoom-inv-scale)) solid var(--grp-color, #e53935);
}

/* リサイズハンドル：12px のつかめる範囲の中に、白地に青 1px の 6px 角を描く */
.handle {
  position: absolute; pointer-events: auto;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  transform: scale(var(--zoom-inv-scale));
}
.handle::after {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 6px; height: 6px;
  background: #fff; border: 1px solid var(--sel);
}
.handle:hover::after { background: var(--sel); }
.handle[data-h="nw"] { left: 0;    top: 0;    cursor: nwse-resize; }
.handle[data-h="n"]  { left: 50%;  top: 0;    cursor: ns-resize; }
.handle[data-h="ne"] { left: 100%; top: 0;    cursor: nesw-resize; }
.handle[data-h="w"]  { left: 0;    top: 50%;  cursor: ew-resize; }
.handle[data-h="e"]  { left: 100%; top: 50%;  cursor: ew-resize; }
.handle[data-h="sw"] { left: 0;    top: 100%; cursor: nesw-resize; }
.handle[data-h="s"]  { left: 50%;  top: 100%; cursor: ns-resize; }
.handle[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }

/* ---------- 付箋 ---------- */
.obj--sticky { z-index: 10; }
.obj--sticky.is-selected { z-index: 20; }
/* 編集モード：付箋の下が透けるよう半透明にする（枠線は出さない） */
.app:not(.is-view-mode) .obj--sticky { opacity: .55; }
/* 開閉方式「表示ボタン削除」・答ボタンに紐付いた付箋：閉じた面は紙色 */
.obj--sticky.is-open-locked:not(.is-open),
.obj--sticky.is-kotae:not(.is-open) { background: #fff !important; }
/* 編集モード：紙色の付箋（答ボタンに紐付いた付箋を含む）は -45° の斜線で見分ける */
.app:not(.is-view-mode) .obj--sticky:is(.is-paper, .is-kotae):not(.is-open-locked) {
  background-image: repeating-linear-gradient(-45deg, rgba(0,0,0,.22) 0 calc(1px * var(--zoom-inv-scale)), transparent calc(1px * var(--zoom-inv-scale)) calc(5px * var(--zoom-inv-scale))) !important;
}
/* 編集モード：「表示ボタン削除」の付箋は格子（-45° と +45° の斜線を重ねる） */
.app:not(.is-view-mode) .obj--sticky.is-open-locked {
  background-image: repeating-linear-gradient(-45deg, rgba(0,0,0,.22) 0 calc(1px * var(--zoom-inv-scale)), transparent calc(1px * var(--zoom-inv-scale)) calc(5px * var(--zoom-inv-scale))),
                    repeating-linear-gradient(45deg, rgba(0,0,0,.22) 0 calc(1px * var(--zoom-inv-scale)), transparent calc(1px * var(--zoom-inv-scale)) calc(5px * var(--zoom-inv-scale))) !important;
}
/* 閲覧モードで開いた付箋は見えなくする（もう一度押すと閉じる） */
.is-view-mode .obj--sticky.is-open { opacity: 0; }
/* 閲覧モード：「表示ボタン削除」の付箋は自分では開けない（大問ボタン・答ボタンでは開く） */
.is-view-mode .obj--sticky.is-open-locked:not(.is-open) { cursor: default; }

/* ---------- 大問ボタン・答ボタン ---------- */
.obj--btn {
  z-index: 5;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; letter-spacing: .05em; line-height: 1; white-space: nowrap;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
  overflow: hidden;
  container-type: size;
}
.obj__label { font-size: 45cqh; pointer-events: none; }
.app:not(.is-view-mode) .obj--btn { opacity: .8; }
.is-view-mode .obj--btn:hover { filter: brightness(.85); }

/* 大問ボタンの制御範囲（大問の仕掛けを選んでいる間だけ表示） */
.group-box {
  position: absolute; pointer-events: none; z-index: 40;
  border: calc(1px * var(--zoom-inv-scale)) solid #e67e22;
}

/* ---------- 右下のロゴ札（本体と同じく編集モードだけ） ---------- */
.badge {
  position: fixed; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center;
  padding: 5px 12px 5px 14px;
  background: var(--chrome); color: #fff;
  border-radius: 8px 0 0 0;
  border-top: 1px solid rgba(255,255,255,.15);
  border-left: 1px solid rgba(255,255,255,.15);
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  pointer-events: none;
}
.badge__tag { margin-left: 8px; font-size: 10px; letter-spacing: normal; opacity: .7; }
.is-view-mode .badge { display: none; }

/* ---------- トースト ---------- */
.toast {
  position: fixed; left: 50%; top: 50%; z-index: 300;
  transform: translate(-50%, -50%);
  padding: 12px 22px; border-radius: 8px;
  background: rgba(30,30,30,.88); color: #fff; font-size: 14px;
  pointer-events: none;
  opacity: 0; transition: opacity .2s;
}
.toast.is-shown { opacity: 1; }
.toast:empty { display: none; }

/* ---------- 狭い画面・タッチ端末 ---------- */
.pc-only { display: none; }
@media (max-width: 900px), (pointer: coarse) {
  body { background: #fff; }
  .app { display: none; }
  .pc-only {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    min-height: 100vh; padding: 32px 20px; text-align: center;
  }
  .pc-only__brand { font-size: 20px; font-weight: 700; }
  .pc-only__msg { font-size: 15px; line-height: 1.8; max-width: 32em; }
  .pc-only__back {
    display: inline-block; padding: 12px 24px;
    background: var(--chrome); color: #fff; border-radius: 10px; text-decoration: none; font-weight: 700;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
