/* Lab activities (matter): thermo, dough, props (site/js/science/lab-matter.js).
   Each lays out side by side on a wide screen and stacked on an upright one;
   the phone rules are at the end. */

/* A results table: what the child measured, a row at a time. */
.mt-table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border-radius: 18px; background: #fff; box-shadow: var(--shadow); font: 400 20px/1.2 var(--book); }
.mt-table th { padding: 8px 10px; background: var(--accent-soft); color: var(--muted); font: 700 15px/1.2 var(--ui); text-align: center; white-space: nowrap; }
.mt-table td { padding: 6px 10px; border-top: 1px solid var(--line); text-align: center; }

/* ---- Thermo: cups of water and a thermometer ---- */

.lab-thermo {
  --gw: 104px; /* a glass */
  --gh: 128px;
  --tube: 200px; /* the thermometer's tube */
  --below: 78px; /* from the bottom of a glass to the bottom of the bench */
  width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  justify-items: stretch;
  align-items: center;
  gap: 16px 28px;
}
.th-bench {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  min-height: calc(var(--tube) + 196px);
  padding: 0 8px;
  border-radius: 24px;
  background: linear-gradient(#eef4fb, #dbe6f3);
}
/* The bench top the glasses stand on, and its wooden front under them. */
.th-bench::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--below) + 4px);
  border-radius: 0 0 24px 24px;
  background: linear-gradient(#d6a86e 0 12px, #b9874f 12px);
}
.th-cups { display: flex; align-items: flex-end; gap: 14px; }
.card.th-cup {
  position: relative;
  display: grid;
  grid-template-rows: auto 34px 32px;
  row-gap: 6px;
  justify-items: center;
  min-width: 0;
  padding: 30px 4px 0;
  border: 0;
  background: none;
  box-shadow: none;
  cursor: pointer;
}
.th-glass {
  position: relative;
  width: var(--gw);
  height: var(--gh);
  border: 4px solid rgb(140 170 205 / 0.85);
  border-top: 0;
  border-radius: 4px 4px 22px 22px;
  background: rgb(255 255 255 / 0.55);
}
.th-glass::before { content: ''; position: absolute; left: -6px; right: -6px; top: -5px; height: 10px; border: 3px solid rgb(140 170 205 / 0.85); border-radius: 50%; }
.th-water { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; height: 48%; border-radius: 0 0 18px 18px; opacity: 0.8; }
.th-water::before { content: ''; position: absolute; left: 0; right: 0; top: -5px; height: 10px; border-radius: 50%; background: inherit; filter: brightness(1.05); }
.th-shine { position: absolute; left: 9%; top: 8%; z-index: 7; width: 7px; height: 64%; border-radius: 6px; background: rgb(255 255 255 / 0.75); pointer-events: none; }
.th-ice { position: absolute; top: -12px; width: 24px; height: 21px; border: 2px solid #9fd5f2; border-radius: 6px; background: linear-gradient(135deg, #fff 30%, #cdefff); }
.th-ice.i0 { left: 12%; }
.th-ice.i1 { left: 40%; top: -8px; }
.th-ice.i2 { left: 66%; }
.th-steam { position: absolute; bottom: calc(100% + 2px); width: 22px; height: 30px; border-radius: 50%; background: radial-gradient(ellipse, rgb(165 182 205 / 0.9), rgb(165 182 205 / 0) 70%); opacity: 0; pointer-events: none; }
.th-steam.s0 { left: 12%; }
.th-steam.s1 { left: 40%; }
.th-steam.s2 { left: 66%; }
.th-ripple { position: absolute; left: 50%; top: -7px; width: 64px; height: 14px; margin-left: -32px; border: 2px solid rgb(255 255 255 / 0.95); border-radius: 50%; }
.th-name { display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px; border: 3px solid transparent; border-radius: 17px; background: #fff; box-shadow: var(--shadow); white-space: nowrap; }
.th-name .card-emoji { font-size: 22px; }
.th-name .card-label { font-size: 17px; }
.th-cup.measured .th-name, .th-cup.right .th-name { border-color: var(--right); }
.th-cup.mixed:not(.right) .th-name { border-color: var(--gold); animation: th-glow 1.2s ease-in-out infinite; }
.th-cup.empty .th-glass { opacity: 0.5; }
@keyframes th-glow { 50% { box-shadow: 0 0 0 6px rgb(242 176 30 / 0.35); } }
.th-warn { align-self: start; width: max-content; max-width: 150px; padding: 2px 8px; border-radius: 10px; background: #fff1d6; color: #8a4b00; font: 700 12px/1.2 var(--ui); text-align: center; }

.th-home { position: relative; flex: none; align-self: stretch; width: 96px; }
.th-stand { position: absolute; left: 14px; bottom: calc(var(--below) - 2px); z-index: 6; width: 50px; height: 22px; border-radius: 8px 8px 4px 4px; background: linear-gradient(#8a6a4a, #6b4f33); }
.th-meter {
  position: absolute;
  right: 14px;
  bottom: calc(var(--below) + 6px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 88px;
  touch-action: none;
  cursor: grab;
  transform-origin: 30px 100%;
}
.th-read { margin-bottom: 6px; padding: 5px 10px; border-radius: 12px; background: var(--ink); color: #fff; font: 800 20px/1 var(--ui); white-space: nowrap; box-shadow: var(--shadow); }
.th-tube { position: relative; width: 30px; height: var(--tube); margin-left: 15px; border: 3px solid #b6c3d6; border-bottom: 0; border-radius: 15px 15px 0 0; background: linear-gradient(90deg, #fff, #e9eff7); }
.th-col { position: absolute; left: 6px; right: 6px; top: 10px; bottom: -6px; }
.th-liquid { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px 4px 0 0; background: #e3342b; }
.th-scale { position: absolute; left: calc(100% + 3px); top: 10px; bottom: 0; width: 36px; }
.th-tick { position: absolute; left: 0; padding-left: 13px; transform: translateY(50%); color: var(--muted); font: 700 12px/1 var(--ui); }
.th-tick::before { content: ''; position: absolute; left: 0; top: 50%; width: 6px; height: 2px; margin-top: -1px; background: #8794a8; }
.th-tick.major::before { width: 10px; }
.th-bulb { width: 46px; height: 46px; margin: -8px 0 0 7px; border: 3px solid #b6c3d6; border-radius: 50%; background: radial-gradient(circle at 35% 32%, #ff9a8f, #e3342b 50%, #b3201a); }
.th-stream { position: absolute; top: 0; left: 0; z-index: 4; width: 12px; border-radius: 6px; opacity: 0; visibility: hidden; }

.th-side { display: grid; justify-items: center; align-content: center; gap: 12px; }
.th-note { min-height: 2.6em; }
.th-what { text-align: left !important; white-space: nowrap; }
.th-row-emoji { font-family: var(--emoji); }
.th-temp { font-weight: 700; white-space: nowrap; }
.th-barcell { width: 42%; }
.th-bar { display: block; height: 14px; overflow: hidden; border-radius: 7px; background: #eef1f6; }
.th-fill { display: block; width: 0; height: 100%; border-radius: 7px; }

/* ---- Dough: a bowl, scoops of flour and water, and kneading ---- */

.lab-dough { width: 100%; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); justify-items: stretch; align-items: center; gap: 16px 28px; }
.dg-lab { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "flour bowl water" "go go go"; align-items: center; justify-items: center; gap: 14px 10px; }
.dg-flour-side { grid-area: flour; }
.dg-water-side { grid-area: water; }
.dg-flour-side, .dg-water-side { display: grid; justify-items: center; gap: 10px; }
.dg-go { grid-area: go; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.dg-add { padding: 0 18px; }
.dg-tally { display: grid; justify-items: center; gap: 6px; }
.dg-n { font: 800 28px/1 var(--ui); }
.dg-icons { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 112px; min-height: 22px; }
.dg-icon { width: 20px; height: 20px; border-radius: 50%; }
.dg-icon.flour { border: 2px solid #d6c39a; border-radius: 50% 50% 30% 30% / 70% 70% 30% 30%; background: radial-gradient(circle at 40% 30%, #fff, #f1e8d4); }
.dg-icon.water { border-radius: 50% 0 50% 50%; background: #3d9be9; transform: rotate(-45deg) scale(0.9); }

/* The bowl, drawn in layers: its inside, what is in it, its front and its rim.
   Everything is a share of --b, the bowl's width. */
.dg-bowl { --b: 380px; grid-area: bowl; position: relative; width: var(--b); height: calc(var(--b) * 0.74); touch-action: none; cursor: pointer; }
.dg-inside, .dg-rim { position: absolute; left: 0; right: 0; top: calc(var(--b) * 0.3); height: calc(var(--b) * 0.175); border-radius: 50%; }
.dg-inside { z-index: 1; background: radial-gradient(ellipse at 50% 40%, #4f7fa6, #34607f); }
.dg-rim { z-index: 4; border: calc(var(--b) * 0.018) solid #e4f0f9; pointer-events: none; }
.dg-front {
  --lip: radial-gradient(calc(var(--b) * 0.5) calc(var(--b) * 0.0875) at 50% 0, transparent 98%, #000 100%);
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--b) * 0.3875); /* the middle of the rim: only the near side of the bowl is in front */
  bottom: 0;
  z-index: 3;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: linear-gradient(#8fc3e8, #5b95c3);
  box-shadow: inset 0 -12px 20px rgb(0 0 0 / 0.15);
  -webkit-mask-image: var(--lip);
  mask-image: var(--lip);
}
.dg-flour, .dg-water { position: absolute; z-index: 2; translate: -50% 0; }
.dg-flour { left: calc(50% - var(--b) * 0.125); bottom: calc(var(--b) * 0.2875); border-radius: 50% 50% 44% 44% / 74% 74% 26% 26%; background: radial-gradient(circle at 42% 30%, #fff, #f3eee2 55%, #ddd3bd); }
.dg-water { left: calc(50% + var(--b) * 0.144); bottom: calc(var(--b) * 0.306); border-radius: 50%; background: radial-gradient(#c8e8ff, #5aaeee); opacity: 0.9; }
.dg-dough { position: absolute; left: 50%; bottom: calc(var(--b) * 0.281); z-index: 2; width: 0; height: 0; }
.dg-ball {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 0;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #fff8e6, #f0d6a0 45%, #d6ab69);
  box-shadow: inset -6px -8px 14px rgb(140 90 30 / 0.22);
  transition: border-radius 0.5s, background 0.5s;
}
.dg-ball.right::after { content: ''; position: absolute; left: 22%; top: 16%; width: 22%; height: 16%; border-radius: 50%; background: rgb(255 255 255 / 0.7); }
.dg-ball.sticky { border-radius: 46% 46% 38% 38% / 34% 34% 66% 66%; background: radial-gradient(circle at 36% 24%, #fff, #f2e8cc 38%, #d8c597); }
.dg-ball.crumbly { border-radius: 42% 58% 47% 53% / 55% 45% 55% 45%; background: radial-gradient(circle at 36% 30%, #fffbf2, #f6ead0 50%, #e3cfa3); box-shadow: none; }
.dg-crack { display: none; position: absolute; }
.dg-crack { height: 3px; border-radius: 2px; background: #b29361; }
.dg-crack.k1 { left: 14%; top: 34%; width: 36%; transform: rotate(28deg); }
.dg-crack.k2 { left: 52%; top: 22%; width: 30%; transform: rotate(-36deg); }
.dg-crack.k3 { left: 40%; top: 62%; width: 34%; transform: rotate(12deg); }
.crumbly .dg-crack { display: block; }
.dg-ball.sticky::after { content: ''; position: absolute; left: 20%; top: 14%; width: 30%; height: 14%; border-radius: 50%; background: rgb(255 255 255 / 0.85); }
.dg-crumbs { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.dg-crumb { position: absolute; left: 0; top: 0; width: 11px; height: 9px; border-radius: 40%; background: #e6d1a3; box-shadow: inset -2px -2px 0 #cdb27c; }
.dg-strings { position: absolute; left: 62%; bottom: calc(var(--b) * 0.375); z-index: 2; display: flex; justify-content: space-between; width: calc(var(--b) * 0.14); height: calc(var(--b) * 0.2); transform-origin: 50% 100%; pointer-events: none; }
.dg-strings span { width: 4px; border-radius: 2px; background: #e2d2a6; }
.dg-hands, .dg-finger { position: absolute; z-index: 5; pointer-events: none; font: calc(var(--b) * 0.2)/1 var(--emoji); }
.dg-hands { left: 50%; top: calc(var(--b) * 0.125); }
.dg-finger { left: 62%; top: calc(var(--b) * 0.09); font-size: calc(var(--b) * 0.17); }
.dg-label { position: absolute; left: 50%; bottom: calc(var(--b) * 0.09); z-index: 6; padding: 6px 16px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font: 800 22px/1 var(--ui); white-space: nowrap; pointer-events: none; }
.dg-label.right { background: var(--right); color: #fff; }
.dg-label.sticky { background: #ffe3b8; color: #8a4b00; }
.dg-label.crumbly { background: #f4e6c8; color: #6b4b1e; }
.dg-progress { position: absolute; left: 22%; right: 22%; bottom: 10px; z-index: 6; height: 10px; overflow: hidden; border-radius: 5px; background: rgb(255 255 255 / 0.7); opacity: 0; transition: opacity 0.3s; }
.dg-progress.on { opacity: 1; }
.dg-progress-fill { display: block; width: 0; height: 100%; border-radius: 5px; background: var(--gold); }
.dg-scoop, .dg-bit { position: absolute; left: 0; top: 0; z-index: 8; pointer-events: none; border-radius: 50%; }
.dg-scoop { width: 28px; height: 28px; margin: -14px; }
.dg-bit { width: 10px; height: 10px; margin: -5px; }
.dg-scoop.flour, .dg-bit.flour { background: radial-gradient(#fff, #efe6d2); box-shadow: 0 0 0 2px #d8cdb5; }
.dg-scoop.water, .dg-bit.water { background: radial-gradient(circle at 35% 30%, #d6f0ff, #3d9be9); }

.dg-side { display: grid; justify-items: center; align-content: center; gap: 12px; }
.dg-note { min-height: 2.6em; }
.dg-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font: 700 16px/1.3 var(--ui); white-space: nowrap; }
.dg-chip.right { background: var(--right-soft); color: #13643a; }
.dg-chip.sticky { background: #ffe9c7; color: #8a4b00; }
.dg-chip.crumbly { background: #f4e6c8; color: #6b4b1e; }

/* ---- Props: a testing station for materials ---- */

.lab-props { width: 100%; justify-items: stretch; gap: 14px; }
.pp-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.card.pp-card { min-width: 108px; cursor: pointer; }
.pp-card .card-emoji { font-size: 46px; }
.pp-card .card-label { font-size: 18px; white-space: nowrap; }
.pp-dots { display: flex; gap: 6px; margin-top: 2px; }
.pp-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.pp-dot.light.on { background: var(--gold); }
.pp-dot.water.on { background: #3d9be9; }
.pp-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); align-items: center; gap: 14px 26px; }
.pp-left { display: grid; justify-items: center; gap: 12px; }
.pp-bench { position: relative; width: 100%; height: 250px; overflow: hidden; border-radius: 24px; background: linear-gradient(#eef4fb, #dfe9f5); }
.pp-wall { position: absolute; top: 0; right: 0; bottom: 0; width: 22%; border-left: 5px solid #b4bfd4; background: linear-gradient(90deg, #d2dae9, #c3cde0); }
.pp-star { position: absolute; left: 50%; top: 40%; font: 54px/1 var(--emoji); opacity: 0.3; filter: grayscale(1); transition: opacity 0.3s, filter 0.3s; }
.pp-star.lit { opacity: 1; filter: drop-shadow(0 0 16px #ffd84d) drop-shadow(0 0 6px #fff3a0); }
.pp-shade { position: absolute; left: 45%; top: 40%; font: 96px/1 var(--emoji); filter: brightness(0) blur(5px); pointer-events: none; }
.pp-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: linear-gradient(#d6a86e 0 8px, #b9874f 8px); }
.pp-torch { position: absolute; left: 3%; top: 40%; z-index: 2; width: 70px; height: 30px; translate: 0 -50%; border-radius: 10px 4px 4px 10px; background: linear-gradient(#4a6797, #253859); }
.pp-torch::before { content: ''; position: absolute; left: 22px; top: -6px; width: 14px; height: 7px; border-radius: 3px 3px 0 0; background: #e3342b; }
.pp-torch-head { position: absolute; right: -18px; top: -10px; width: 22px; height: 50px; border-radius: 4px 12px 12px 4px; background: linear-gradient(#5675aa, #2d4471); }
.pp-lens { position: absolute; right: 2px; top: 7px; bottom: 7px; width: 7px; border-radius: 4px; background: #cfd8e6; transition: background 0.2s, box-shadow 0.2s; }
.pp-torch.on .pp-lens { background: #fff7b8; box-shadow: 0 0 14px 6px #ffe66d; }
.pp-beam { position: absolute; top: 40%; height: 64px; transform-origin: 0 50%; pointer-events: none; }
.pp-beam.a { left: calc(3% + 90px); width: calc(43% - 130px); background: linear-gradient(90deg, rgb(255 234 110 / 0.95), rgb(255 234 110 / 0.6)); clip-path: polygon(0 36%, 100% 0, 100% 100%, 0 64%); }
.pp-beam.b { left: calc(46% + 30px); width: calc(32% - 30px); background: linear-gradient(90deg, rgb(255 234 110 / 0.6), rgb(255 234 110 / 0.35)); clip-path: polygon(0 4%, 100% 0, 100% 100%, 0 96%); }
.pp-thing { position: absolute; left: 46%; top: 40%; z-index: 2; font: 104px/1 var(--emoji); }
.pp-stand { position: absolute; left: 46%; top: calc(40% + 50px); bottom: 18%; z-index: 1; width: 64px; translate: -50% 0; border-radius: 6px 6px 0 0; background: linear-gradient(90deg, #9aa6b8, #c4ccd8 40%, #8d99ab); }
.pp-puddle { position: absolute; left: 46%; bottom: calc(18% - 8px); z-index: 1; width: 210px; height: 16px; margin-left: -105px; border-radius: 50%; background: rgb(70 155 230 / 0.6); opacity: 0; visibility: hidden; }
.pp-beads { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.pp-bead { position: absolute; width: 11px; height: 11px; margin: -5px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #5fb0f0); }
.pp-drop { position: absolute; left: 0; top: 0; z-index: 4; width: 12px; height: 16px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: #3d9be9; pointer-events: none; }
.pp-jug { position: absolute; left: calc(46% + 22px); top: 15%; z-index: 4; width: 44px; height: 50px; border: 4px solid #9cb2cb; border-top-width: 2px; border-radius: 3px 3px 12px 12px; background: rgb(255 255 255 / 0.7); transform-origin: 0 0; pointer-events: none; }
.pp-jug-water { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; border-radius: 0 0 8px 8px; background: #6cb6f0; }
.pp-hint { position: absolute; left: 46%; top: 40%; translate: -50% -50%; padding: 8px 14px; border: 3px dashed #b9c6dc; border-radius: 16px; color: var(--muted); font: 400 22px/1.2 var(--book); white-space: nowrap; }
.pp-side { display: grid; justify-items: center; gap: 12px; }
.pp-note { min-height: 2.6em; }
.pp-what { text-align: left !important; white-space: nowrap; }
.pp-row-emoji { font-family: var(--emoji); }
.pp-cell { font: 800 26px/1 var(--ui); }
.pp-cell.yes { color: var(--right); }
.pp-cell.no { color: var(--wrong); }

/* ---- An upright screen: stacked ---- */

@media (max-aspect-ratio: 1/1) {
  .lab-thermo, .lab-dough, .pp-main { grid-template-columns: minmax(0, 1fr); }
  .th-side, .dg-side, .pp-side { width: min(560px, 100%); justify-self: center; }
}

/* ---- Phones: held upright (narrow) or on their side (short) ---- */

@media (max-width: 600px), (max-height: 500px) {
  .mt-table { border-radius: 14px; font-size: 15px; }
  .mt-table th { padding: 5px 6px; font-size: 12px; }
  .mt-table td { padding: 4px 6px; }

  .lab-thermo { --gw: 66px; --gh: 84px; --tube: 130px; --below: 66px; gap: 10px 16px; }
  .th-bench { gap: 2px; min-height: calc(var(--tube) + 158px); padding: 0 4px; border-radius: 18px; }
  .th-bench::before { border-radius: 0 0 18px 18px; }
  .th-cups { gap: 4px; }
  .card.th-cup { grid-template-rows: auto 28px 26px; row-gap: 5px; padding-top: 26px; }
  .th-name { height: 28px; gap: 2px; padding: 0 6px; border-width: 2px; }
  .th-name .card-emoji { font-size: 15px; }
  .th-name .card-label { font-size: 12px; }
  .th-warn { max-width: 96px; padding: 1px 4px; font-size: 10px; }
  .th-ice { width: 15px; height: 14px; top: -8px; border-radius: 4px; }
  .th-steam { width: 16px; height: 22px; }
  .th-home { width: 70px; }
  .th-stand { left: 6px; width: 40px; height: 18px; }
  .th-meter { right: 4px; width: 66px; transform-origin: 22px 100%; }
  .th-read { margin-bottom: 4px; padding: 3px 7px; font-size: 15px; }
  .th-tube { width: 22px; margin-left: 11px; border-width: 2px; }
  .th-col { left: 4px; right: 4px; top: 8px; }
  .th-scale { width: 28px; top: 8px; }
  .th-tick { padding-left: 9px; font-size: 10px; }
  .th-tick::before { width: 4px; }
  .th-tick.major::before { width: 7px; }
  .th-bulb { width: 34px; height: 34px; margin: -6px 0 0 5px; border-width: 2px; }
  .th-barcell { width: 34%; }
  .th-bar { height: 10px; }

  .lab-dough { gap: 10px 16px; }
  .dg-lab { gap: 8px; }
  .dg-bowl { --b: 260px; }
  .dg-label { padding: 4px 12px; font-size: 17px; }
  .dg-flour-side, .dg-water-side { gap: 6px; }
  .dg-add { padding: 0 14px; }
  .dg-go { gap: 10px; }
  .dg-n { font-size: 20px; }
  .dg-icons { max-width: 140px; min-height: 16px; gap: 3px; }
  .dg-icon { width: 15px; height: 15px; }
  .dg-icon.flour { border-width: 2px; }
  .dg-chip { padding: 1px 6px; font-size: 13px; }

  .lab-props { gap: 10px; }
  .pp-cards { flex-wrap: nowrap; gap: 6px; }
  .card.pp-card { flex: 1 1 0; min-width: 0; max-width: 86px; padding: 5px 3px 4px; }
  .pp-card .card-emoji { font-size: 30px; }
  .pp-card .card-label { font-size: 12px; white-space: normal; }
  .pp-dots { gap: 4px; }
  .pp-dot { width: 9px; height: 9px; }
  .pp-main { gap: 10px 16px; }
  .pp-left { gap: 8px; }
  .pp-bench { height: 190px; border-radius: 18px; }
  .pp-star { font-size: 38px; }
  .pp-shade { font-size: 66px; }
  .pp-torch { left: 2%; width: 46px; height: 22px; }
  .pp-torch::before { left: 14px; width: 10px; height: 5px; top: -5px; }
  .pp-torch-head { right: -14px; top: -8px; width: 16px; height: 38px; }
  .pp-lens { top: 6px; bottom: 6px; width: 5px; }
  .pp-beam { height: 46px; }
  .pp-beam.a { left: calc(2% + 62px); width: calc(44% - 92px); }
  .pp-beam.b { left: calc(46% + 22px); width: calc(32% - 22px); }
  .pp-thing { font-size: 70px; }
  .pp-stand { top: calc(40% + 34px); width: 44px; }
  .pp-puddle { width: 150px; margin-left: -75px; height: 12px; }
  .pp-jug { left: calc(46% + 14px); width: 32px; height: 36px; }
  .pp-hint { padding: 5px 10px; font-size: 16px; }
  .pp-cell { font-size: 20px; }
  .pp-table th { white-space: normal; }
}

/* An upright phone: the bowl above its two scoop buttons. */
@media (max-width: 600px) {
  .dg-lab { grid-template-columns: 1fr 1fr; grid-template-areas: "bowl bowl" "flour water" "go go"; }
}

/* A phone on its side: a narrower table, and a smaller bowl between the scoop buttons. */
@media (max-height: 500px) and (min-width: 601px) {
  .lab-thermo, .lab-dough, .pp-main { grid-template-columns: minmax(0, 1fr) minmax(220px, 270px); }
  .dg-bowl { --b: 200px; }
  .dg-add { padding: 0 12px; }
}

/* The smallest phones: names on two lines, so three cups fit across. */
@media (max-width: 350px) {
  .lab-thermo { --gw: 56px; --gh: 76px; }
  .th-bench { padding: 0 2px; }
  .card.th-cup { padding-left: 0; padding-right: 0; }
  .th-home { width: 56px; }
  .th-name { width: 70px; height: 28px; padding: 0 3px; border-radius: 10px; white-space: normal; line-height: 1.05; }
  .th-name .card-emoji { font-size: 13px; }
  .th-name .card-label { font-size: 11px; line-height: 1.05; }
  .dg-bowl { --b: 236px; }
  .pp-card .card-label { font-size: 11px; }
}

/* An iPad Air on its side in Safari (about 1180 × 700): the props station is shorter, so a
   two-line instruction never sits under the materials. */
@media (min-width: 900px) and (min-height: 501px) and (max-height: 780px) {
  .lab-props { gap: 8px; }
  .card.pp-card { padding-block: 4px; }
  .pp-card .card-emoji { font-size: 34px; }
  .pp-bench { height: 180px; }
  .pp-star { font-size: 44px; }
  .pp-shade { font-size: 78px; }
}
