<figure><img src="image_24.png" /></figure>

Plot: Energy balance vs Tmin

2549

2550

2551

Fig. S14. Daily net energy gain ($NEG_d$) for Scenario 5 at different minimum nocturnal temperatures ($T_{N,min}$) and with a default metabolic rate ($DMR_{20}$) of 0.1. The circle represents the tipping point between positive and negative effects of nocturnal temperature increase on $NEG_d$.

2552

2553

2554

2555

(g) Effects of efficient AR at low temperature

2556

2557

2558

2559

2560

For many nocturnal ectotherms, the efficiency of locomotion is higher at lower temperatures and the thermal performance curve (TPC) for locomotion plateaus at lower temperatures than in closely related diurnal ectotherms, which may represent a thermal adaptation to nocturnal life. This thermal adaptation can greatly improve AR efficiency at night (Dayananda et al., 2020; Ibargüengoytía et al., 2007).

2561

2562

2563

2564

To evaluate the effect of higher efficiency, we simulated this scenario by modifying parameters *b* and *q* of the default AR function (see Fig. S15). The consequence of this change was that $T_{opt}$ for nocturnal AR was slightly lower (decreased from 30 °C to 27 °C) than in diurnal species.
<figure><img src="image_25.png" /><figcaption>**Fig. S15.** Comparison of different attack rates (AR) functions for a diurnal (yellow) and nocturnal (blue) ectotherm.</figcaption></figure>

Fig. S16 shows the difference in NEG<sub>d</sub> for a nocturnal species using a modified AR that better represents the physiology of a nocturnal species (left panel) and for a nocturnal species with an AR similar to that used for the diurnal species of Scenarios 1–4 (right panel). As expected, the adjusted AR increased NEG<sub>d</sub> but caused a more rapid decline above T<sub>N,opt</sub>. To enhance comparisons between Scenarios 1–4 and Scenario 5, we made the deliberate choice to work with a diurnal AR for the nocturnal species. Note that with a modified AR (i.e. nocturnal AR; Scenario 5b in Fig. S16), NEG<sub>d</sub> are slightly higher. However, conclusions provided in the main manuscript for the nocturnal species remain unchanged.
<figure><img src="image_26.png" /><figcaption>**Fig. S16.** Comparison of NEG<sub>d</sub> for different attack rates (AR) functions. In scenario 5, AR is parameterized to match the AR used for previous scenarios (Scenarios 1–4), to facilitate comparison. In Scenario 5b, AR is modified to better represent the AR of a nocturnal species (see Fig. S15). Coloured lines represent different DMR<sub>20</sub> values (black = 0.01; yellow = 0.05; blue = 0.1; green = 0.15). Solid dots represent T<sub>N, opt</sub>.</figcaption></figure>

2578

2579

2580

2581

2582

2583

2584
2585

2586

**Appendix S5. Empirical analysis of energy balance**

2587

2588

2589

2590

2591

2592

2593

2594

2595

2596

2597

2598

We used unpublished data from the experiment described in Brusch IV *et al.* (2023) to analyse the effects of diurnal and nocturnal temperatures on energy balance. Gravid female common lizards (*Zootoca vivipara*; mean body mass at capture 3–4 g) captured in natural populations in France during early gestation were raised under controlled laboratory conditions until parturition and exposed to four combinations of nocturnal and diurnal temperatures (cold and hot treatments) as well as two levels of humidity over the gestation period [see Brusch IV *et al.* (2023) for details]. We analysed records of weekly food intake (total mass of crickets consumed) and weekly mass change (total body mass change) for 131 females measured during gestation (633 observations, ~5 weekly measurements per female). Over most of the gestation period (40–60 days), body mass increased non-linearly with time, before plateauing (and sometimes decreasing) close to parturition (Fig. S17). We observed an average mass increase of +1.8 g during gestation. A similar pattern can be observed for food intake, with females ceasing to feed when close to parturition (Fig. S18).

2599

2600

2601

2602

2603

2604

2605

2606

2607

2608

2609

We first estimated a conversion factor of 0.31 between weekly food intake (g food/week) and food intake (g/week) using a linear regression. We then estimated the efficiency of energy transformation. To do this, we analysed the (normally distributed) residuals from the previous linear regression throughout gestation and according to the experimental treatments. Gestation time was included as a non-linear factor (time²) and estimated as the number of days from the start of the experiment. Experimental treatments (day temperature, night temperature and humidity; described in Brusch IV *et al.*, 2023) were implemented as additive and interactive effects. Female identity was included as a random effect to control for repeated measures and allow for individual variation in the intercept. We used manual backward selection to remove non-significant interactions until the best model was obtained (significance threshold *P* < 0.05) (Table S5). See also Section IV.4 of the main article.

<figure><img src="image_27.png" /><figcaption>**Fig. S17.** Records of female common lizard (*Zootoca vivipara*) body mass change over the gestation period. Mass increased in the early stages of pregnancy (positive change) before stabilizing (mass change ≈0).</figcaption></figure>

2610
<figure><img src="image_28.png" /><figcaption>**Table S5.** Results of ANOVA linear mixed-effect model relating the efficiency of energy transformation to time [both as a linear effect (time) and a non-linear effect (time²)], and to diurnal and nocturnal temperatures. Significant interaction terms are also reported.</figcaption></figure>

<table><thead><tr><th></th><th>Numerator</th><th>Denominator</th><th>F value</th><th>P</th></tr><tr><th></th><th>DF</th><th>DF</th><th></th><th></th></tr></thead><tbody><tr><td>Intercept</td><td>1</td><td>498</td><td>17.33</td><td>&lt;0.005</td></tr><tr><td>Time</td><td>1</td><td>498</td><td>25.18</td><td>&lt;0.005</td></tr><tr><td>Time<sup>2</sup></td><td>1</td><td>498</td><td>28.08</td><td>&lt;0.005</td></tr><tr><td>Diurnal temperature</td><td>1</td><td>128</td><td>3.66</td><td>0.058</td></tr><tr><td>Nocturnal temperature</td><td>1</td><td>128</td><td>4.05</td><td>0.046</td></tr><tr><td>Time × Diurnal temperature</td><td>1</td><td>498</td><td>12.18</td><td>&lt;0.005</td></tr><tr><td>Time<sup>2</sup> × Diurnal temperature</td><td>1</td><td>498</td><td>22.84</td><td>&lt;0.005</td></tr></tbody></table>