/* バーチャル教室の部品(vc/ に写したもの)の見た目(2026-11-23 段3)。
   元は 塾/バーチャル教室_ブラウザ版/web/css/app.css。色は OS(緑)に合わせ、OS のほかの画面に効かないよう .vcparts の中だけにした。
   小窓(dialog)とお知らせ(#toasts)は body の直下に出るので、そこだけ外に置く。 */
.vcparts { --accent: var(--primary); --accent-light: #86efac; --surface: #fff; --hairline: var(--line); --ink: var(--text); --ink-2: var(--muted); --soft: var(--tint); --success: var(--deep); --danger: #c62828; }
/* 部品は hidden で出し入れする。OS の button { display: inline-flex } に負けないように */
.vcparts [hidden], .dialog [hidden] { display: none !important; }
.vcparts .note { color: var(--muted); font-size: 0.9rem; margin: 0 0 8px; }
.vcparts .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vcparts .button.primary { background: var(--btn); color: #fff; }
.vcparts .button.secondary { background: var(--tint); color: var(--deep); }
.vcparts .button.danger { background: #fdecec; color: var(--danger); }
.vcparts .button.leave { background: #fff; color: var(--text); border: 1.5px solid var(--line); }
.vcparts .button.text { background: none; color: var(--deep); padding: 6px 8px; }
.vcparts .button.small { min-height: 36px; padding: 4px 14px; font-size: 0.85rem; }
.vcparts .button.wide { width: 100%; }
.vcparts .button-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* 通話の画面と通話中のノート */
.vcparts .call-frame { position: relative; height: min(70vh, 560px); min-height: 320px; border-radius: 18px; overflow: hidden; background: #1d1d1f; display: flex; align-items: center; justify-content: center; }
.vcparts .call-status { color: #f2f2f7; text-align: center; padding: 16px; margin: 0; }
.vcparts .call-mock { background: #fff; border-radius: 12px; padding: 20px; margin: 16px; text-align: center; }
.vcparts .call-mock-title { font-weight: 700; }
/* 通話中のノート(先生と生徒の2人で書ける板。板は正方形) */
.vcparts .call-stage { display: flex; flex-direction: column; gap: 12px; }
.vcparts .call-stage-bar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.vcparts .call-stage-bar .note { margin: 0; }
.vcparts .call-board[hidden] { display: none; }
.vcparts .call-board { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vcparts .board-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vcparts .board-paper { position: relative; width: min(100%, max(280px, calc(100vh - 200px))); aspect-ratio: 1 / 1; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
@supports (height: 100svh) { .vcparts .board-paper { width: min(100%, max(280px, calc(100svh - 200px))); } }
.vcparts .board-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.vcparts .board-status { min-height: 1.3em; margin: 0; color: var(--muted); font-size: 0.85rem; text-align: center; }
.vcparts .call-stage.board-open .call-frame { height: 180px; min-height: 0; }
@media (max-width: 699px) {
  .vcparts .call-stage.board-open .board-hint { display: none; }
  .vcparts .board-tools { gap: 4px; }
  .vcparts .board-tools .pen-button { padding: 4px 10px; font-size: 0.85rem; }
}
/* iPad の横向きやパソコン: 板と通話の画面を横に並べる */
@media (min-width: 900px) and (orientation: landscape) {
  .vcparts .call-stage.board-open { display: grid; align-items: start; grid-template-areas: "bar bar" "board call"; grid-template-columns: minmax(0, min(calc(100% - 272px), max(280px, calc(100vh - 160px)))) minmax(260px, 1fr); }
  @supports (height: 100svh) { .vcparts .call-stage.board-open { grid-template-columns: minmax(0, min(calc(100% - 272px), max(280px, calc(100svh - 160px)))) minmax(260px, 1fr); } }
  .vcparts .call-stage.board-open .call-stage-bar { grid-area: bar; }
  .vcparts .call-stage.board-open .call-board { grid-area: board; }
  .vcparts .call-stage.board-open .board-paper { margin: 0; width: 100%; }
  .vcparts .call-stage.board-open .call-frame { grid-area: call; height: min(60vh, 480px); min-height: 240px; }
}

/* ペン */
.vcparts .pen-button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 0.88rem; font-weight: 700; color: var(--text); cursor: pointer; }
.vcparts .pen-button[aria-pressed="true"] { border-color: var(--primary); background: var(--tint); }
.vcparts .pen-swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.15); }
.vcparts .pen-black .pen-swatch { background: #2E2117; }
.vcparts .pen-red .pen-swatch { background: #D93A2B; }
.vcparts .pen-blue .pen-swatch { background: #1E6FD9; }
.vcparts .pen-marker .pen-swatch { background: rgba(255, 214, 10, 0.6); border-radius: 4px; }
.vcparts .pen-eraser .pen-swatch { background: #fff; border: 2px dashed var(--muted); }

/* 動画の回答を録る板(書いて話す)と再生 */
.vcparts .recorder { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; }
.vcparts .rec-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vcparts .rec-status { font-weight: 700; color: var(--muted); }
.vcparts .rec-status.on { color: var(--danger); }
.vcparts .rec-time { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.vcparts .rec-pens { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vcparts .rec-pens .button { margin-left: auto; }
.vcparts .rec-board { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.vcparts .rec-canvas { display: block; width: 100%; aspect-ratio: 4 / 3; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.vcparts .rec-live { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.vcparts .rec-foot { display: flex; justify-content: flex-end; }
.vcparts .player { margin: 8px 0; }
.vcparts .player-board { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.vcparts .player-canvas { display: block; width: 100%; aspect-ratio: 4 / 3; }
.vcparts .player-controls { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.vcparts .player-play { flex: none; min-width: 110px; }
.vcparts .player-slider { flex: 1; accent-color: var(--primary); min-width: 0; }
.vcparts .player-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.vcparts .video-preview { display: flex; flex-direction: column; gap: 8px; }

/* 通話中の画面(OS の画面の上に重ねる。OS が画面を描き直しても、通話の枠は作り直さない) */
.vccallover { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow: auto; padding: 16px; }
.vccallover .vccallinner { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.vccallover h1 { font-size: 1.3rem; margin: 0; }

/* 小窓とお知らせ(部品が body の直下に出す) */
.dialog { border: 0; border-radius: 18px; padding: 24px; max-width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); color: var(--text); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.dialog h2 { font-size: 1.1rem; margin: 0 0 8px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.dialog-actions .button { flex: 1 1 120px; }
.dialog .button.primary { background: var(--btn); color: #fff; }
.dialog .button.danger { background: var(--danger); color: #fff; }
#toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 70; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
#toasts .toast { position: static; transform: none; opacity: 1; max-width: none; border-radius: 14px; font-weight: 700; transition: opacity 0.4s ease, transform 0.4s ease; }
#toasts .toast-success { background: var(--deep); }
#toasts .toast-error { background: var(--danger); }
#toasts .toast-hide { opacity: 0; transform: translateY(8px); }
