/* A warm illustrated notebook, with touch-sized experiments and picture cards. */
.science-board{--lab-green:#47755b;--lab-cream:#fffbee;padding:24px;background:var(--lab-cream);border:1px solid #d6dfc3;border-radius:24px;box-shadow:0 6px 22px #42654b0c;text-align:left}
.science-notebook{display:flex;align-items:center;gap:14px;margin-bottom:16px}.science-notebook h2{font-size:clamp(1.35rem,2.2vw,1.8rem);line-height:1.2;margin:5px 0;color:#345c48}.science-lab-mark{display:grid;place-items:center;width:52px;height:52px;flex-shrink:0;border-radius:17px;background:#efd4ad;color:#80603d;font-size:30px}.science-question{margin:0 0 18px;font-size:clamp(1.1rem,1.5vw,1.35rem);line-height:1.5;color:#3e5848;font-weight:650}
.science-scene{width:100%;height:auto;display:block;margin:12px 0 20px;max-height:248px;overflow:visible}.science-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.science-cards button.science-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:10px;min-height:142px;border:2px solid #d5dfc8;border-radius:18px;background:#fffdf6;color:#3b5649;font-size:1rem;font-weight:750;box-shadow:0 4px 0 #dce3d0}.science-card .science-icon{width:min(100%,130px);height:106px}.science-card:hover{border-color:#89aa79;background:#f3f7e7}.science-card:focus-visible,.plant-part:focus-visible{outline:4px solid #d6a668;outline-offset:4px}.science-cards button.science-card.selected{background:#e4efce;border-color:#638958;box-shadow:0 4px 0 #9db88a}.science-card.selected:after{content:'✓';position:absolute;right:9px;top:6px;color:#416d45;background:#fff9e9;width:27px;height:27px;display:grid;place-items:center;border-radius:50%}.science-card:disabled{opacity:.45}.solved .science-card:disabled{opacity:.8}
.science-tools{display:flex;justify-content:flex-end;align-items:center;gap:12px;flex-wrap:wrap;margin-top:20px}.science-tools button{min-height:48px;border-radius:14px}.science-selected{margin-right:auto;color:#6c7d64;font-weight:650}.science-cycle{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:0;list-style:none;margin:18px 0 22px}.science-cycle:has(li:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr))}.science-cycle li{position:relative;min-height:154px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#eef2df;border:2px dashed #b6c59f;border-radius:18px;padding:16px 8px 8px;text-align:center;font-size:.95rem}.science-cycle li:not(:last-child):after{content:'→';position:absolute;right:-15px;z-index:1;background:#fffbee;color:#6b8c58;font-size:21px}.science-cycle .science-icon{width:95px;height:90px}.science-step{position:absolute;top:-12px;left:calc(50% - 14px);width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#b2c393;color:#395541;font-weight:800}.science-empty{color:#7e8f73;font-size:.95rem}.cycle-pieces{grid-template-columns:repeat(4,minmax(0,1fr))}.cycle-pieces .science-card{min-height:140px}.cycle-pieces .science-icon{height:94px}
.science-plant{position:relative;min-height:0;margin:8px 0 20px}.science-plant .science-scene{max-height:330px}.science-plant button.plant-part{position:absolute;z-index:1;border:2px solid #70945e;background:#fffbee;border-radius:20px;min-height:48px;padding:9px 18px;color:#3c6549;font-weight:750;box-shadow:0 4px 0 #bbcea1}.part-roots{left:40%;top:77%}.part-stem{left:25%;top:43%}.part-leaves{left:58%;top:20%}.science-test-buttons{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}.science-test-buttons button{min-height:46px;border-radius:14px;border:1px solid #b2c3ad}.science-test-buttons button[aria-pressed=true]{background:#e2ebd7;border-color:#65875e}.science-observation{text-align:center;min-height:3em;color:#64765b;font-size:.98rem;margin:10px 0 20px;line-height:1.5}
.matter-sample{display:flex;align-items:center;justify-content:center;gap:20px;padding:12px 0 18px;background:#edf2df;border-radius:18px;margin-bottom:20px}.matter-sample>.science-icon{width:145px;height:136px}.matter-sample h3{margin:7px 0;font-size:1.45rem}.science-phases{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.science-phases button{display:flex;align-items:center;flex-direction:column;padding:12px;border-radius:18px;background:#fffdf5;border:2px solid #c6d4ba;min-height:140px;font-size:1.1rem}.science-phases .science-icon{width:110px;height:95px}.science-collection{display:flex;flex-wrap:wrap;gap:10px;color:#4c7754;font-weight:650}.science-discovery{padding:18px 20px;background:#e2edcc;border:1px solid #c3d6a8;border-radius:18px;margin:22px 0 0;color:#3c6045;animation:science-reveal .4s ease-out}.science-discovery>b{font-size:1.2rem}.science-discovery p{margin:8px 0 0;line-height:1.55}.science-success{animation:science-reveal .5s ease-out}.science-source{margin:22px 0;padding:15px 18px;border:1px solid #d4ddc2;border-radius:16px;background:#f5f7e9;color:#57714e}.science-source summary{cursor:pointer;font-weight:750}.science-source p{line-height:1.5;font-size:.95rem}.science-source a{color:#356951}.science-source ul{padding-left:20px;font-size:.95rem;line-height:1.6}
@keyframes science-reveal{from{opacity:.4;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:700px){.science-board{padding:16px;border-radius:18px}.science-notebook{gap:10px}.science-lab-mark{width:43px;height:43px}.science-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.science-cycle{gap:8px}.science-cycle li{min-height:132px;padding:15px 4px 8px;font-size:.82rem}.science-cycle .science-icon{width:68px;height:74px}.science-cycle li:not(:last-child):after{right:-11px;font-size:16px}.cycle-pieces{grid-template-columns:repeat(2,minmax(0,1fr))}.science-phases{gap:8px}.science-phases button{padding:8px;min-height:124px}.science-phases .science-icon{width:80px;height:85px}.matter-sample{gap:12px;padding:12px}.matter-sample>.science-icon{width:100px;height:100px}.matter-sample h3{font-size:1.2rem}.science-plant button.plant-part{padding:7px 12px;min-height:44px;font-size:.9rem}.part-roots{left:35%;top:76%}.part-stem{left:11%;top:41%}.part-leaves{left:61%;top:14%}.science-tools .primary{width:100%}.science-empty{font-size:.8rem}}
@media(prefers-reduced-motion:reduce){.science-discovery,.science-success{animation:none}}.reduce-motion .science-discovery,.reduce-motion .science-success{animation:none}

.science-progress{padding:13px 16px;background:#edf2dc;border:1px solid #d0ddbd;border-radius:14px;color:#49674c;line-height:1.5;font-weight:650}.science-evidence{margin:12px 0 20px;padding:16px 20px;background:#eff3e2;border:1px solid #cad8bc;border-radius:16px;color:#425f49}.science-evidence table{width:100%;border-collapse:collapse;margin-top:8px;line-height:1.5}.science-evidence th,.science-evidence td{text-align:left;padding:8px 12px;border-bottom:1px solid #d1ddc4}.science-evidence th{width:38%;font-weight:700}.science-matter-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.science-matter-item{background:#edf2df;border-radius:16px;padding:12px}.science-matter-item .matter-sample{display:flex;flex-direction:column;gap:4px;margin-bottom:10px;padding:0;text-align:center}.science-matter-item .matter-sample h3{font-size:1.15rem}.science-matter-item .science-phases{grid-template-columns:1fr;gap:8px}.science-matter-item .science-phases button{min-height:44px;padding:10px;font-size:1rem}.science-phases button[aria-pressed=true],.plant-part[aria-pressed=true]{background:#d2e5bc!important;border:3px solid #567e51!important;box-shadow:0 0 0 3px #edf3dc}.science-tools .primary{min-height:50px}.science-card.selected:after{content:"✓";position:absolute;top:8px;right:10px;color:#4f7850;font-size:1.3rem;font-weight:800}.science-card{position:relative}@media(max-width:600px){.science-matter-grid{grid-template-columns:1fr}.science-matter-item .matter-sample{flex-direction:row;justify-content:flex-start;gap:15px}.science-matter-item .matter-sample>.science-icon{width:78px;height:78px}.science-matter-item .science-phases{grid-template-columns:repeat(3,minmax(0,1fr))}.science-evidence{padding:12px}.science-evidence th,.science-evidence td{padding:8px 6px;font-size:.95rem}}

/* Science-specific controls stay near the question on compact screens. */
.science-game #play { scroll-margin-top: 6px; }
.science-game .science-nav { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 4px 8px; background: #edf5e7; border-radius: 12px; }
.science-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 10px; color: #355e49; font-weight: 750; }
.science-question, .science-game #mission-win { scroll-margin-top: 64px; }
.science-game .science-tools { position: sticky; bottom: 0; z-index: 2; padding: 6px; background: #fffdf2; border-radius: 12px; }
.science-game .science-clue { padding: 9px 12px; background: #f1f1d5; border-radius: 10px; color: #405331; }
.science-phase-notice { margin: 6px 0; color: #3b5744; font-weight: 750; }
.science-observe { padding: 12px; border-radius: 12px; background: #edf6e5; }
.science-pace { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 6px 0; }
.science-pace input { width: 20px; height: 20px; accent-color: #416c4f; }
.science-lobby-panel { padding: 8px 12px; margin: 6px 0; border: 1px solid #cbdcca; border-radius: 12px; background: #f3f9ed; }
.science-lobby-panel summary { min-height: 42px; padding-top: 7px; cursor: pointer; font-weight: 750; }
.science-lobby-panel input[type="date"] { min-height: 44px; max-width: 100%; padding: 6px; margin: 0 4px 6px 0; }
#science-topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px,100%),1fr)); gap: 6px; margin: 8px 0; padding-left: 20px; }
#science-topics progress { width: min(100%, 135px); display: block; accent-color: #508159; }
#science-earned-medals { padding: 0; list-style: none; }
#science-demo { width: min(505px,calc(100% - 24px)); padding: 18px; border: 2px solid #67906a; border-radius: 16px; color: #355e49; background: #f9fdf5; }
#science-demo::backdrop { background: #243b30a3; }
.science-demo-title, .science-demo-buttons { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.science-demo-title h2 { margin: 0; }
.science-demo-picture { font-size: 36px; min-height: 60px; padding: 6px 12px; border-radius: 12px; background: #e5efdd; }
.science-demo-picture.tested span { background: #fff0a7; box-shadow: 0 0 14px #e2bb4c; }
@media(max-width:720px){
  .science-game .lobby-copy { order: -1; }
  .science-game .lobby-copy .lobby-actions { margin: 8px 0; }
  .science-game .lobby-art { max-height: 260px; }
}
@media(max-width:740px),(max-height:550px){
  .science-game .science-board { padding: 8px 12px; }
  .science-game .science-question { margin: 6px 0; }
  .science-game .science-notebook { padding: 4px 8px; }
  .science-game #play .stage { padding: 8px; }
}
.science-game #play .stage { overflow: visible; }
.science-game #stage [data-action] { scroll-margin-top: 64px; scroll-margin-bottom: 66px; }
@media(max-height:520px) and (orientation:landscape){
  .science-game .science-scene { max-height: 125px; margin: 4px 0 8px; }
  .science-game .science-plant .science-scene { max-height: 170px; }
  .science-game .science-cards button.science-card { min-height: 105px; padding: 6px; }
}
@media(max-height:520px) and (orientation:landscape){
  .science-game .header { padding: 6px 12px; }
  .science-game .lobby { align-items: start; margin-top: 4px; }
  .science-game .lobby-copy { padding: 10px 16px; }
  .science-game .lobby-copy h1 { font-size: 30px !important; line-height: 1.08; margin: 3px 0 6px; }
  .science-game .lobby-copy #difficulty-hint { margin: 4px 0; }
  .science-game .lobby-copy .lobby-actions { margin: 5px 0; }
}
@media(max-height:520px) and (orientation:landscape){
  .science-game #learning-label { display: none; }
  .science-start-controls { display: grid; grid-template-columns: minmax(0,1fr) max-content; gap: 4px 8px; align-items: end; }
  .science-start-controls label { grid-column: 1 / -1; margin-bottom: 0; }
  .science-start-controls #difficulty { width: 100%; min-width: 0; }
  .science-game .lobby-copy .science-start-controls .lobby-actions { margin: 0; }
}
