
:root{font-family:'Trebuchet MS',Arial,sans-serif;color:#fff8e9;background:#78d8e6;font-synthesis:none;--purple:#482477;--yellow:#ffd43e;--pink:#f77cb9}*{box-sizing:border-box}body{margin:0;overflow:hidden}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;font-weight:900;cursor:pointer;border:0;color:inherit}button:focus-visible,a:focus-visible{outline:4px solid #fff;outline-offset:4px}button:active{transform:translateY(2px)}[hidden]{display:none!important}#world{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none}#loading{position:fixed;inset:0;z-index:50;background:radial-gradient(circle at 50% 38%,#684198,#2b174f);display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:30px}#loading a{color:#cfb7e6;font-size:14px;margin-top:30px}.loading-blocks{display:flex;gap:12px}.loading-blocks b{display:grid;place-items:center;width:70px;height:70px;border-radius:15px;background:#ffd33f;color:#67377f;font-size:40px;box-shadow:0 8px 0 #c8871f;animation:bob 1.1s infinite alternate}.loading-blocks b:nth-child(2){background:#5de0dc;box-shadow:0 8px 0 #218fa9;animation-delay:.2s}.loading-blocks b:nth-child(3){background:#f899d3;box-shadow:0 8px 0 #b54d9b;animation-delay:.4s}@keyframes bob{to{transform:translateY(-12px) rotate(4deg)}}#load-status{color:#dac5ec}#retry{background:#ffd33f;color:#482477;border-radius:20px;padding:14px 30px}#menu{position:fixed;inset:0;background:linear-gradient(90deg,rgba(39,17,69,.94) 0%,rgba(46,23,78,.85) 30%,rgba(46,23,78,.2) 59%,transparent 80%)}.menu-top{display:flex;justify-content:space-between;align-items:center;padding:24px 4vw}.menu-top img{width:190px;display:block}.island-pill{font-size:12px;letter-spacing:2px;padding:12px 18px;background:#fff9e5e8;color:#43604e;border-radius:30px;box-shadow:0 3px 0 #64948d33}.menu-copy{margin-left:6vw;width:450px;padding-top:2vh}.eyebrow{color:#60ded8;font-size:12px;font-weight:900;letter-spacing:2.5px}h1{font-size:clamp(60px,6.8vw,105px);line-height:.9;margin:20px 0;font-weight:1000;letter-spacing:-5px;text-shadow:0 4px 0 #c17a21,0 9px 0 #762e5c,0 15px 25px #16092366;transform:rotate(-3deg);color:#ffdc49}h1 span:first-child{color:#fff1a3}h1 small{font-size:.65em;color:#7aebe4;text-shadow:0 4px 0 #259bba,0 8px 0 #482678}.title-dot{color:#f99bd1}.tagline{font-size:18px;line-height:1.5;color:#ebdef3;margin:22px 0}.lesson-pills{display:flex;gap:10px}.lesson-pills span{display:flex;gap:5px;align-items:center;flex-direction:column;font-size:10px;color:#dfcce8;min-width:90px;padding:7px 12px;border:1px solid #ffffff1f;border-radius:12px;background:#ffffff09}.lesson-pills b{color:#ffe071;letter-spacing:2px;font-size:15px}.lesson-pills span:nth-child(2) b{color:#67e1dd}.lesson-pills span:nth-child(3) b{color:#f3a3d1}.choose-label{font-size:11px;letter-spacing:2px;margin:24px 0 10px;color:#e7d3f1}.hero-choices{display:flex;gap:10px}.hero-choice{position:relative;width:88px;min-height:88px;background:#fff3e711;border:2px solid #ffffff20;border-radius:18px;padding:0 3px 8px;transition:background .2s,transform .2s}.hero-choice img{width:64px;height:57px;object-fit:contain;display:block;margin:-5px auto 1px}.hero-choice span{font-size:11px}.hero-choice.selected{border-color:var(--hero-color);background:#fff7e524;box-shadow:0 0 0 2px #00000009}.hero-choice.selected:after{content:'✓';position:absolute;right:-5px;top:-7px;background:var(--hero-color);border-radius:50%;width:19px;height:19px;color:#382156;font-size:12px;line-height:19px}.primary{background:linear-gradient(#ffe778,#ffd33d);color:#51316e;padding:18px 30px;border-radius:18px;box-shadow:0 5px 0 #c99126,0 10px 30px #25123a24;letter-spacing:.6px;font-size:18px}.menu-copy>.primary{width:382px;margin-top:23px;display:flex;justify-content:space-between;font-size:22px}.primary span{font-size:28px;line-height:25px}.play-caption{font-size:11px;letter-spacing:1px;color:#bca9cc;margin:15px 0 0 55px}.world-caption{position:absolute;right:5vw;bottom:110px;display:flex;gap:10px;align-items:center;text-shadow:0 2px 8px #315747;pointer-events:none}.world-caption b{display:block;font-size:13px;letter-spacing:1px}.world-caption span:not(.small-star){display:block;font-size:12px;margin-top:5px}.small-star{font-size:45px;color:#ffe176}.menu-bottom{position:absolute;bottom:0;left:0;right:0;display:flex;align-items:center;gap:25px;padding:22px 4vw;background:linear-gradient(transparent,#2917444d)}.menu-bottom button{font-size:11px;letter-spacing:1px;background:none;padding:10px 0}.menu-bottom>span{margin-left:auto;font-size:11px;color:#fffdf1c9}.overlay{position:fixed;inset:0;z-index:30;display:flex;align-items:center;justify-content:center;background:#301b5499;padding:20px;overflow:auto}.dialog{max-width:510px;background:#fff7e9;color:#583674;text-align:center;border-radius:32px;padding:32px;box-shadow:0 10px 0 #44286540,0 20px 80px #1a0c4a44;border:3px solid #fffdf7}.dialog h2{font-size:30px;line-height:1.1;margin:10px 0 16px}.dialog p{font-size:14px;line-height:1.6;color:#806c8c}.dialog .primary,.dialog .secondary{display:block;width:100%;margin-top:16px}.dialog a{display:block;margin-top:20px;font-size:12px;color:#82669a}.secondary{background:#eee0f5;color:#6b4788;border-radius:14px;padding:15px}.dialog-icon{font-size:50px;color:#f6b835}.welcome{max-width:650px}.how-steps{display:flex;gap:16px;margin:25px 0}.how-steps>div{flex:1;background:#f0e8f7;border-radius:15px;padding:16px 10px}.how-steps b{display:grid;place-items:center;margin:auto auto 10px;width:30px;height:30px;background:#facb42;border-radius:50%}.how-steps strong,.how-steps span{display:block}.how-steps strong{font-size:12px}.how-steps span{font-size:12px;line-height:1.5;margin-top:8px}.control-note{font-size:12px!important}.victory .eyebrow{color:#ad7bbe;letter-spacing:1px;font-size:10px}.victory h2{font-size:36px;color:#7340a2}.victory-score{background:#f1e2f8;border-radius:15px;padding:16px;color:#8a4ca0;font-size:12px}.victory-score strong{font-size:28px;margin:0 6px}button{touch-action:manipulation}#joystick,#touch-fire,#touch-jump{touch-action:none}
@media(max-height:760px) and (min-width:900px){.menu-top{padding:16px 4vw}.menu-top img{width:150px}.menu-copy{padding-top:0}.menu-copy h1{font-size:76px;margin:15px 0}.tagline{font-size:15px;margin:16px 0}.choose-label{margin-top:16px}.hero-choice{min-height:76px}.hero-choice img{height:47px}.menu-copy>.primary{padding:12px 25px;margin-top:17px}.lesson-pills span{padding:5px 10px}.menu-bottom{padding:10px 4vw}}
@media(max-height:550px) and (orientation:landscape){.menu-top{padding:10px 24px}.menu-top img{width:120px}.island-pill{font-size:9px;padding:8px 12px}.menu-copy{margin-left:5vw;width:350px;padding:0}.eyebrow{font-size:9px}.menu-copy h1{font-size:51px;letter-spacing:-2px;margin:9px 0}.tagline{font-size:12px;line-height:1.3;margin:12px 0}.lesson-pills{display:none}.choose-label{font-size:8px;margin:10px 0 7px}.hero-choices{gap:7px}.hero-choice{width:64px;min-height:58px;border-radius:12px;padding:0 2px 4px}.hero-choice img{height:35px;width:44px}.hero-choice span{font-size:8px}.menu-copy>.primary{width:278px;font-size:16px;padding:9px 18px;margin-top:12px;border-radius:12px}.play-caption{display:none}.menu-bottom{padding:6px 24px;gap:20px}.menu-bottom button,.menu-bottom>span{font-size:8px}.world-caption{bottom:60px;right:25px}.world-caption b{font-size:9px}.world-caption span:not(.small-star){font-size:9px}.dialog{padding:16px 25px;max-height:94vh;overflow:auto}.dialog h2{font-size:24px;margin:8px 0}.dialog-icon{font-size:30px}.how-steps{margin:12px 0;gap:10px}.how-steps>div{padding:10px}.dialog p{margin:9px 0}.dialog .primary{font-size:15px;padding:12px}}
@media(max-width:600px) and (orientation:portrait){#menu{background:linear-gradient(180deg,#321a56dd,#321a56bb 45%,#321a56ee)}.menu-top{padding:17px 20px}.menu-top img{width:145px}.island-pill{font-size:7px;letter-spacing:1px;padding:8px}.menu-copy{width:auto;margin:0 25px;text-align:center;padding-top:2vh}.eyebrow{font-size:9px}.menu-copy h1{font-size:70px;letter-spacing:-3px;margin:20px 0}.tagline{font-size:15px;margin:18px 0}.lesson-pills{justify-content:center;gap:8px}.lesson-pills span{min-width:85px}.choose-label{margin-top:25px}.hero-choices{justify-content:center;gap:7px}.hero-choice{width:72px;min-height:80px}.hero-choice img{width:57px;height:52px}.hero-choice span{font-size:10px}.menu-copy>.primary{width:100%;margin-top:23px;font-size:21px}.play-caption{margin:15px 0}.menu-bottom{padding:15px 25px;justify-content:center}.menu-bottom>span{display:none}.world-caption{display:none}.dialog{padding:25px 20px}.dialog h2{font-size:26px}.how-steps{gap:7px}.how-steps>div{padding:12px 7px}.how-steps span{font-size:10px}.victory h2{font-size:30px}}
@media(max-width:600px) and (max-height:700px) and (orientation:portrait){.menu-copy{padding:0}.menu-copy h1{font-size:57px;margin:14px 0}.tagline{margin:14px 0;font-size:13px}.choose-label{margin-top:18px}.menu-copy>.primary{padding:13px 24px;margin-top:18px}.hero-choice{min-height:70px}.hero-choice img{height:45px}.menu-top img{width:125px}.lesson-pills span{padding:5px 10px}}
@media(prefers-reduced-motion:reduce){.loading-blocks b{animation:none}*{scroll-behavior:auto}}

.hud-top {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.overlay { align-items: flex-start; }
.dialog { margin: auto; }
#target-hint {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 11px;
  min-height: 40px;
  border-radius: 14px;
  background: #3e2654e8;
  font-size: 14px;
}
#target-arrow { display: block; width: 20px; text-align: center; color: #ffe079; font-size: 21px; }
#collection { border-left: 1px solid #ffffff40; padding-left: 9px; color: #ffe079; font-size: 13px; }
#pause, .game-actions button, #build-hint button {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid #ffffff60;
  background: #3e2654ed;
  font-size: 13px;
}
#pause { min-width: 44px; pointer-events: auto; font-size: 18px; }
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff9;
  text-shadow: 0 1px 3px #302047;
  pointer-events: none;
}
#toast {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top)) + 52px);
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content;
  padding: 7px 11px;
  border-radius: 12px;
  background: #fff5df;
  color: #502e69;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
#toast.show { opacity: 1; }
.game-actions, #build-hint {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  gap: 6px;
}
#tool-picker { position: relative; }
#toolbar {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: calc(100% + 6px);
  display: grid;
  gap: 4px;
  width: max-content;
  padding: 5px;
  border-radius: 14px;
  background: #382351;
}
#toolbar .tool { text-align: left; }
#toolbar .tool[aria-pressed="true"], .game-actions .active, .game-actions .bridge-action {
  background: #ffe079;
  color: #482477;
  box-shadow: none;
}
#build-hint { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 50px); }
#touch-controls { display: none; }

@media (any-pointer: coarse), (max-width: 800px) {
  #desktop-place { display: none !important; }
  #touch-controls { display: block; }
  #crosshair { display: none; }
  #joystick {
    position: absolute;
    left: max(12px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 94px;
    height: 94px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid #fff7e8a6;
    background: #51317740;
  }
  #stick { width: 36px; height: 36px; border-radius: 50%; background: #fff5debd; pointer-events: none; }
  #joystick > span { position: absolute; bottom: 6px; font-size: 9px; text-shadow: 0 1px 3px #382351; pointer-events: none; }
  .touch-actions {
    position: absolute;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    align-items: flex-end;
    gap: 7px;
  }
  .touch-actions button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #fff6df;
    background: #69408aeb;
    font-size: 21px;
    line-height: 1.05;
  }
  .touch-actions #touch-fire, .touch-actions #touch-place { width: 62px; height: 62px; background: #ffe079; color: #482477; }
  .touch-actions small { display: block; margin-top: 3px; font-size: 8px; }
  .game-actions { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 69px); }
  #build-hint { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 119px); }
}

@media (max-height: 550px) and (orientation: landscape) {
  #menu { overflow-y: auto; }
  .menu-bottom { position: static; }
}

#loading {
  background: linear-gradient(#1a183778, #241637db), url("./assets/grove-title.webp") center / cover;
}
#menu {
  background: linear-gradient(90deg, #25123cf5 0%, #301b4cdc 35%, #34204e36 65%, transparent 84%);
}
.menu-copy h1 {
  color: #ffcf49;
  -webkit-text-stroke: 1px #ffe79e;
  text-shadow: 0 4px #bf741d, 0 9px #7b3a3c, 0 13px #351846, 0 19px 26px #190c30a8;
}
.menu-copy h1 small { -webkit-text-stroke: 1px #aef6e6; }
#target-hint, #pause, .game-actions button, #build-hint button {
  border: 1px solid #f2c7679c;
  background: linear-gradient(#543576f5,#2f1a48f5);
}
.game-actions .active, .game-actions .bridge-action, #toolbar .tool[aria-pressed="true"] {
  background: linear-gradient(#fff09f,#ffcb55);
}
@media (max-width: 600px) and (orientation: portrait) {
  #menu {
    background: linear-gradient(#281840ad 0%,#27113e89 38%,#29183ce8 82%), url("./assets/grove-title.webp") center / cover;
  }
}

/* Mission handoffs and an intentionally separate, readable building box. */
.mission-dialog .eyebrow,.catalog-head .eyebrow{color:#916399;font-size:10px;letter-spacing:1.4px}
.mission-symbols{font-size:64px;font-weight:900;letter-spacing:10px;margin:22px 0 12px;color:#e3a322;text-shadow:0 3px #ffe5a4,0 5px #ba752a}
.mission-dialog{max-width:460px}.mission-dialog h2{font-size:30px}.mission-dialog p{font-size:16px}
#block-picker{z-index:35;background:#251841b8}
.catalog-dialog{width:min(540px,100%);max-width:540px;max-height:calc(100dvh - 24px);overflow-y:auto;padding:20px;overscroll-behavior:contain}
.catalog-head{display:flex;align-items:center;justify-content:space-between;text-align:left;gap:12px}
#picker-close{width:38px;height:38px;flex-shrink:0;border-radius:50%;color:#674779;background:#eadfee}
.catalog-dialog h2{font-size:23px;line-height:1.25;margin:12px 0 6px}.catalog-dialog p{margin:6px 0 14px;line-height:1.4;font-size:13px}
.catalog-tabs{display:flex;gap:6px;margin-bottom:14px}.catalog-tabs button{flex:1;border-radius:12px;padding:12px 5px;font-size:12px;color:#745486;background:#e9ddf0}
.catalog-tabs button[aria-selected=true]{background:#5d3b81;color:#fff5db}
#block-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px;padding:5px}
.catalog-block{min-height:53px;border:2px solid #e4c383;border-radius:12px;background:linear-gradient(#fffdf2,#ffe6a2);color:#60427e;box-shadow:0 4px #d3b17e;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:5px 2px}
.catalog-block b{font-size:29px;line-height:1.1}.catalog-block small{font-size:8px;line-height:1.3;text-transform:capitalize}
.catalog-block.required{border-color:#278b80;background:linear-gradient(#d0ffeb,#7ee3c9);box-shadow:0 4px #42a88f}
.catalog-block:focus-visible{outline:3px solid #8465c7;outline-offset:2px}.catalog-footer{margin:16px 0 0!important;font-size:11px!important}
.help-goal{border-radius:12px;background:#e5f1e6;padding:12px;color:#45644b!important;font-weight:bold}
#help{z-index:40}#help .dialog{max-height:calc(100dvh - 30px);overflow:auto}
@media(max-width:360px){.catalog-dialog{padding:14px}.catalog-block{min-height:46px}.catalog-block b{font-size:24px}#block-grid{gap:7px}.catalog-dialog h2{font-size:20px}.catalog-head .eyebrow{font-size:8px}}
@media(max-height:480px) and (orientation:landscape){.catalog-dialog{max-width:650px}.catalog-dialog h2{font-size:18px}.catalog-dialog p{font-size:11px;margin-bottom:8px}.catalog-tabs{margin-bottom:8px}.catalog-tabs button{padding:7px}.catalog-block{min-height:44px}.catalog-footer{display:none}#block-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.mission-symbols{font-size:40px;margin:4px}.mission-dialog p{font-size:13px}}
