/* 島の通話：どのタブにいても続く小さな窓。下のタブ（--tab-h）の上、右下に置く。モーダル（#layer 20）とトースト（30）より下 */
.callwin { position: fixed; z-index: 12; right: calc(8px + env(safe-area-inset-right, 0px)); bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  width: min(340px, calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  max-height: calc(100vh - var(--tab-h) - var(--safe-b) - var(--safe-t) - 72px);
  max-height: calc(100dvh - var(--tab-h) - var(--safe-b) - var(--safe-t) - 72px);
  display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; background: rgba(18, 26, 63, .97); border: 2px solid var(--line); border-radius: 16px;
  box-shadow: 0 6px 0 #04061a, 0 10px 30px rgba(0, 0, 0, .45); overflow: hidden; animation: callIn .2s cubic-bezier(.2, .9, .3, 1.2); }
.callwin::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--rainbow); }
@keyframes callIn { from { transform: translateY(12px); opacity: 0; } }

.chead { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ctitle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 4px; border: 0; background: none; cursor: pointer; text-align: left; }
.cdot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(46, 230, 166, .6); }
.cdot.talk { animation: callPulse .9s ease-out infinite; }
@keyframes callPulse { to { box-shadow: 0 0 0 8px rgba(46, 230, 166, 0); } }
.cname { flex: 1; min-width: 0; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctime, .ccount { flex: none; font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.cfold { flex: none; width: 36px; height: 36px; border: 2px solid var(--line); border-radius: 10px; background: var(--panel2); cursor: pointer; font-size: 14px; line-height: 1; }

.cnote { font-size: 13px; color: var(--sub); text-align: center; }
.cnote[hidden] { display: none; }
.ctap { width: 100%; }

.ctiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow: auto; min-height: 0; overscroll-behavior: contain; }
.ctile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 6px 2px 4px; border-radius: 12px; background: var(--panel2); }
.cface { position: relative; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 3px solid var(--line); transition: border-color .12s, box-shadow .12s; display: grid; place-items: center; background: #141b48; }
.cface img.face, .cface video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ctile.me .cface video { transform: scaleX(-1); }
.cnone { color: var(--dim); font-weight: 800; }
.ctile.talk .cface { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(46, 230, 166, .35); }
.cnm { max-width: 100%; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmic { position: absolute; top: 4px; right: 6px; font-size: 13px; display: none; }
.ctile.muted .cmic { display: block; }
.cst { font-size: 10px; color: var(--accent); line-height: 1.2; text-align: center; }
.cst:empty { display: none; }
.ctile.wait .cface { opacity: .55; }

.cctl { display: flex; gap: 6px; }
.cctl .btn { flex: 1 1 0; min-width: 0; padding: 6px 6px; white-space: nowrap; font-size: 13px; }
/* ミュート中は白く（赤い「退出」と見分ける） */
.cmute.on { background: #fff; color: #1a1f4a; border-color: #000; }
.ccam[aria-pressed="true"] { background: var(--r5); color: #021826; border-color: #000; }

/* 小さくした形：丸い帯（タップで広げる） */
.callwin.min { width: auto; max-width: min(300px, calc(100vw - 16px)); padding: 4px 4px 4px 10px; border-radius: 999px; gap: 0; }
.callwin.min::before { display: none; }
.callwin.min .cnote, .callwin.min .ctiles, .callwin.min .cctl { display: none; }
.callwin.min .cfold { border-radius: 50%; }

/* 小さくした帯のあいだは、ロビーの下のボタン（あいさつ・＋など）を帯の上へ逃がす。開いた窓は上に重なる板なので逃がさない。
   背の低い画面（横向き）は逃がすと上が隠れるので、帯をまん中に置く（下の @media） */
@media (min-height: 501px) {
  body.in-call.call-min .lobby .hud { bottom: calc(10px + var(--call-h, 48px)); }
}

/* 背の低い画面（スマホの横向きなど）：タイルを1列に並べて背を低く */
@media (max-height: 500px) {
  .callwin { width: min(440px, calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))); gap: 6px; padding: 6px 8px 8px; }
  .ctiles { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .ctile { padding: 4px 1px 2px; }
  .cface { width: 40px; height: 40px; border-width: 2px; }
  .cnm { font-size: 11px; }
  .cst { display: none; }
  .callwin.min { right: auto; left: 50%; transform: translateX(-50%); }
}

/* 相手の声の出口（見えないが鳴る） */
.callaudio { position: fixed; width: 0; height: 0; overflow: hidden; left: 0; top: 0; pointer-events: none; }

/* マイクの直し方 */
.callhelp h3 { font-size: 18px; margin-bottom: 10px; }
.callhelp p { margin: 0 0 10px; color: var(--sub); }
.callhelp .row { justify-content: flex-end; margin-top: 6px; }
