/* Calling Cara from a minigame (game/minicall.js, docs/98): the call card in the bottom-left corner, her captions
   under it, and the minigames' "Call Cara" buttons. */

/* (above the minigames' title, pause and end screens, z-index 10, so a call placed from them can be seen and hung up;
   under the phone itself, 60) */
.mcall { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 20; width: min(230px, 46vw); display: grid; gap: 8px; pointer-events: none; font-family: var(--font-body); color: #fff; }
.mcall__card { pointer-events: auto; border-radius: 16px; overflow: hidden; background: rgba(10, 20, 16, 0.82); border: 1px solid rgba(160, 255, 200, 0.28); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45); }
.mcall__face { position: relative; aspect-ratio: 4 / 3; background: radial-gradient(ellipse at 50% 35%, #3d4f5a, #1b262d); }
/* (in picture-in-picture her face is drawn on the game's own canvas, right behind this box: it stays see-through) */
.mcall--pip { width: min(196px, 40vw); }
.mcall--pip .mcall__face { aspect-ratio: 3 / 4; background: transparent; }
.mcall:not(.mcall--pip) .mcall__face { aspect-ratio: auto; height: 64px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.mcall__face img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(160, 255, 200, 0.6); flex: none; }
.mcall__wave { display: block; width: 100%; max-width: 120px; height: 24px; }
/* (on a picture-in-picture card the wave is a small speaking sign in the top corner, over the wall, never over her face) */
.mcall--pip .mcall__wave { position: absolute; top: 7px; right: 7px; width: 36px; height: 14px; padding: 2px 3px; border-radius: 6px; background: rgba(8, 16, 12, 0.45); }
.mcall__bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font: 600 0.85rem/1 var(--font-body); }
.mcall__bar b { font-weight: 800; }
.mcall__time { flex: 1; color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; font-size: 0.78rem; }
.mcall__dot { width: 8px; height: 8px; border-radius: 50%; background: #f2c230; flex: none; animation: mcall-blink 1s ease-in-out infinite alternate; }
.mcall.is-live .mcall__dot { background: #3ff090; animation: none; box-shadow: 0 0 8px #3ff090; }
.mcall__btn { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 0.9rem; cursor: pointer; display: grid; place-items: center; }
.mcall__btn:hover { background: rgba(255, 255, 255, 0.22); }
.mcall__btn.is-off { background: rgba(220, 60, 50, 0.6); }
.mcall__btn--end { background: #d6402f; }
.mcall__btn--end:hover { background: #e85a48; }
.mcall__cap { position: absolute; left: 0; bottom: calc(100% + 8px); width: max-content; max-width: min(340px, calc(100vw - 28px)); margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(8, 16, 12, 0.78); font: 600 0.92rem/1.35 var(--font-body); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
/* docked: a small pill in the top-right corner while a title, pause or end screen is up */
.mcall.is-docked { left: auto; bottom: auto; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); width: auto; }
.mcall.is-docked .mcall__face, .mcall.is-docked .mcall__cap { display: none; }
.mcall.is-docked .mcall__card { border-radius: 999px; }
.mcall.is-docked .mcall__time { flex: none; }
@keyframes mcall-blink { from { opacity: 0.35; } to { opacity: 1; } }

/* the "Call Cara" buttons on the minigames' screens and HUD: green, with a ringing handset */
.gbtn.gbtn--call { background: linear-gradient(135deg, #1f9a5a, #2fc077); color: #fff; border-color: rgba(160, 255, 200, 0.5); }
.gbtn.gbtn--call .gbtn__sub { color: rgba(255, 255, 255, 0.85); }
.gbtn.gbtn--call.is-oncall { background: linear-gradient(135deg, #2a6a4a, #3a8a5a); }
.rhud__btn.rhud__btn--call { background: #1f9a5a; box-shadow: 0 0 0 2px rgba(160, 255, 200, 0.35); }
.rhud__btn.rhud__btn--call.is-oncall { background: #d6402f; }
.gbtn--call .gbtn__label::before, .rhud__btn--call:not(.is-oncall)::before { content: ''; }

@media (max-width: 560px) { .mcall { width: min(170px, 44vw); } .mcall__cap { font-size: 0.82rem; } }
@media (prefers-reduced-motion: reduce) { .mcall__dot { animation: none; } }

/* ---- a phone (narrow, or on its side): the screen is small enough to play on already, so while she plays the call
   is only a bubble in the corner: her photo (her live face in a small frame in Drone Dash), a ring that glows as she
   speaks (--lv, set by minicall.js), and her captions in two short lines. A tap on it opens the whole card (mute, the
   phone, hang up) for a few seconds; no button sits under a thumb to hang up by mistake. */
@media (max-width: 560px), (max-height: 500px) {
  .mcall:not(.is-docked):not(.is-open) { width: auto; }
  .mcall:not(.is-docked):not(.is-open) .mcall__bar,
  .mcall:not(.is-docked):not(.is-open) .mcall__wave { display: none; }
  .mcall:not(.is-docked):not(.is-open) .mcall__card { width: 46px; height: 46px; border-radius: 50%; cursor: pointer; border: 2px solid rgba(242, 194, 48, 0.85); box-shadow: 0 0 0 calc(var(--lv, 0) * 5px) rgba(63, 240, 144, 0.4), 0 3px 10px rgba(0, 0, 0, 0.45); transition: box-shadow 0.08s linear; }
  .mcall.is-live:not(.is-docked):not(.is-open) .mcall__card { border-color: #3ff090; }
  .mcall:not(.mcall--pip):not(.is-docked):not(.is-open) .mcall__face { height: 100%; padding: 0; display: block; background: none; }
  .mcall:not(.is-docked):not(.is-open) .mcall__face img { width: 100%; height: 100%; border: 0; }
  /* (her live face: a small portrait frame; the picture is drawn on the game's canvas behind it) */
  .mcall--pip:not(.is-docked):not(.is-open) .mcall__card { width: 54px; height: 72px; border-radius: 10px; }
  .mcall--pip:not(.is-docked):not(.is-open) .mcall__face { aspect-ratio: auto; height: 100%; }
  .mcall:not(.is-docked):not(.is-open) .mcall__cap:not([hidden]) { max-width: min(240px, 60vw); padding: 5px 9px; border-radius: 10px; font-size: 0.76rem; line-height: 1.3; max-height: calc(2.6em + 10px); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  /* (tapped open: the whole card) */
  /* (wide enough for the whole bar: her name, the time and the three buttons) */
  .mcall.is-open { width: min(214px, 64vw); }
}
@media (prefers-reduced-motion: reduce) { .mcall__card { transition: none; } }
