:root{font-family:Inter,ui-rounded,"Noto Sans",system-ui,sans-serif;color:#234b3d;background:#c8e4ca;--deep:#4e8354}*{box-sizing:border-box}html,body{margin:0;min-height:100%;overflow-x:hidden}body{background:radial-gradient(circle at 20% 10%,#fff8d3,transparent 38rem),linear-gradient(145deg,#fff7d7,#b8dfc2)}button,select{font:inherit}button{cursor:pointer}.screen[hidden]{display:none!important}.screen{width:min(100%,920px);margin:auto}.main{min-height:100svh;padding:max(16px,env(safe-area-inset-top)) 20px;display:grid;grid-template-rows:58px 1fr}.main-header,.scene-header{display:grid;grid-template-columns:112px minmax(0,1fr) 112px;align-items:center;text-align:center}.return,.scene-header>button{justify-self:start;width:46px;height:46px;display:grid;place-items:center;border:0;border-radius:14px;background:#fffbed;color:#234b3d;text-decoration:none;font-size:1.35rem}.main-header>strong{font-size:.76rem;letter-spacing:.16em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.locale{justify-self:end;text-align:left;font-size:.68rem;font-weight:850;display:grid}.locale select{max-width:112px;border:1px solid #c8c789;border-radius:9px;padding:5px;background:#fff}.hero{display:grid;grid-template-columns:minmax(260px,470px) 1fr;gap:clamp(28px,6vw,70px);align-items:center}.hero>img{width:100%;border-radius:32px;box-shadow:0 22px 60px #466a3b2b}.eyebrow{margin:0;color:#4e8354;font-size:.75rem;font-weight:900;letter-spacing:.14em}.hero h1{font-size:clamp(2.7rem,7vw,5rem);line-height:.94;letter-spacing:-.05em;margin:.15em 0}.hero p{line-height:1.55}.primary{border:0;border-radius:15px;padding:14px 24px;background:linear-gradient(135deg,#5a9d60,#3f754a);color:#fff;font-weight:900;box-shadow:0 8px 20px #416d4633}.hero details{margin-top:16px;border-top:1px solid #b4cfaa;padding-top:10px}.hero summary{font-weight:900}.canvas{height:calc(100svh - 56px);min-height:430px;background:linear-gradient(155deg,#fffdf0,#d8eed7);overflow:hidden}.scene-header{height:76px;padding:10px 16px;background:#41764d;color:#fff}.scene-header small{font-size:.66rem;letter-spacing:.13em;opacity:.75}.scene-header h2{margin:2px 0 0;font-size:1.16rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scene-header>span{justify-self:end;font-size:.78rem;font-weight:850}.stage{display:grid;grid-template-rows:76px 1fr 66px}.stage-grid{overflow:auto;padding:16px;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;align-content:start}.stage-card{min-height:92px;border:2px solid transparent;border-radius:17px;padding:12px;background:#fbfff0;color:#234b3d;text-align:left;box-shadow:0 7px 18px #44694218}.stage-card.selected{border-color:#5b9c5f;background:#e8f6df}.stage-card:disabled{opacity:.42}.stage-card strong,.stage-card span{display:block}.stage-card span{margin-top:8px;font-size:.75rem}.enter{justify-self:center;align-self:center;min-width:180px}.battle{display:grid;grid-template-rows:76px 1fr}.battle-content{min-height:0;display:grid;grid-template-rows:minmax(0,1fr) 50px 30px;gap:8px;place-items:center;padding:10px 16px}.board{width:min(88vw,calc(100svh - 245px),560px);aspect-ratio:1;display:grid;grid-template-columns:repeat(6,1fr);gap:5px;padding:7px;border-radius:23px;background:#b8d8b5;box-shadow:0 14px 35px #436d4227}.cell{position:relative;min-width:0;border:0;border-radius:9px;background:#f3f4d9;box-shadow:inset 0 -3px 0 #c0d7b4}.cell.source{background:#f6c13f}.cell.goal{background:#a8dba8}.cell.mirror{background:#edf4d8}.cell.mirror::after{content:"";position:absolute;inset:14%;background:linear-gradient(45deg,transparent 44%,#6f9cbd 45% 55%,transparent 56%);transition:transform .16s ease}.cell.mirror[data-rot="1"]::after{transform:rotate(90deg)}.cell.beam{box-shadow:inset 0 0 0 4px #f4ca45,0 0 10px #f7ce4c}.cell.hit{animation:glow .8s infinite}.tools{display:flex;gap:8px}.tools button,dialog button{min-height:44px;border:1px solid #b2c99d;border-radius:12px;background:#fbfff0;color:#234b3d;padding:9px 15px;font-weight:850}.status{margin:0;text-align:center;font-weight:850;font-size:.83rem}dialog{width:min(430px,calc(100% - 28px));border:0;border-radius:25px;text-align:center;padding:28px;color:#234b3d;background:#fbfff0;box-shadow:0 28px 80px #304b3377}dialog::backdrop{background:#203d26aa;backdrop-filter:blur(4px)}.result-mark{width:72px;height:72px;border-radius:50%;display:grid;place-items:center;margin:auto;background:#f2bd3f;color:#fff;font-size:2rem;font-weight:950}dialog h2{margin:.2rem 0}dialog>div:last-child{display:flex;justify-content:center;gap:9px;margin-top:18px}dialog .primary{background:#4f8654;color:#fff}@keyframes glow{50%{filter:brightness(1.25)}}@media(max-width:680px){.main-header{grid-template-columns:70px minmax(0,1fr) 100px}.hero{grid-template-columns:1fr;text-align:center;gap:18px}.hero>img{width:min(70vw,320px);justify-self:center}.hero h1{font-size:clamp(2.5rem,13vw,4rem)}.stage-grid{grid-template-columns:repeat(3,1fr);padding:12px}}@media(max-height:500px) and (orientation:landscape){.canvas{height:calc(100svh - 56px);min-height:0}.scene-header{height:58px;padding:5px 12px}.stage{grid-template-rows:58px 1fr 54px}.stage-grid{grid-template-columns:repeat(6,1fr);padding:8px}.stage-card{min-height:72px}.battle{grid-template-rows:58px 1fr}.battle-content{grid-template-columns:minmax(260px,330px) 180px;grid-template-rows:1fr 30px;justify-content:center;gap:8px 18px;padding:6px}.board{grid-column:1;grid-row:1/3;width:min(300px,calc(100svh - 70px))}.tools{grid-column:2;grid-row:1;display:grid;width:100%;align-self:center}.status{grid-column:2;grid-row:2}}
body #stage{grid-template-rows:76px minmax(0,1fr);background:linear-gradient(#24472fdd,#24472fdd),var(--wp-stage-art) center/cover}body #stageGrid{display:flex;align-items:center;gap:16px;padding-inline:calc(50% - 132px);overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;touch-action:pan-y}body #stageGrid::-webkit-scrollbar{display:none}body #stageGrid .stage-card{width:264px;min-width:264px;height:190px;scroll-snap-align:center;border:2px solid #a7d278;border-radius:19px;padding:16px;background:linear-gradient(180deg,#173f2840 10%,#173f28e8 86%),url("../../assets/animal-sunbeam-garden-cover-general-v3.webp") var(--stage-card-position,center)/cover;color:#fff9d0;text-align:left;display:grid;align-content:end;gap:8px;text-shadow:0 2px 5px #102c22;box-shadow:0 12px 26px #203d2666}body #stageGrid .stage-card.selected,body #stageGrid .stage-card.centered{border-color:#ffe66f;background:linear-gradient(180deg,#315f2630 5%,#163f27d5 88%),url("../../assets/animal-sunbeam-garden-cover-general-v3.webp") var(--stage-card-position,center)/cover;box-shadow:0 0 0 3px #68a96a,0 0 28px #fff0a0}body #stageGrid .stage-card.locked{filter:saturate(.72) brightness(.68)}.ad-reserve{width:min(100%,920px);height:56px;margin:auto;background:#17243a}@media(max-height:500px) and (orientation:landscape){body #stage{grid-template-rows:58px minmax(0,1fr)}}
.cell{background:transparent;box-shadow:none}.cell.source{background:transparent url("../../assets/animal-sunbeam-garden-sun-v1.webp") center/contain no-repeat}.cell.goal{background:transparent url("../../assets/animal-sunbeam-garden-flower-v1.webp") center/contain no-repeat}.cell.goal.hit{background-image:url("../../assets/animal-sunbeam-garden-flower-hit-v1.webp")}.cell.mirror{background:transparent}.cell.mirror::after{inset:2%;background:url("../../assets/animal-sunbeam-garden-mirror-v2.webp") center/contain no-repeat;filter:drop-shadow(0 3px 2px #25463444)}.cell.mirror[data-rot="1"]::after{transform:rotate(90deg)}
.board{background-image:none}.cell,.cell.mirror{background-color:transparent;background-image:url("../../assets/animal-sunbeam-garden-cell-v1.webp");background-position:center;background-repeat:no-repeat;background-size:100% 100%}
@media(max-height:500px) and (orientation:landscape){body #battle .board{width:min(264px,calc(100svh - 126px))}}

/* Interface v4: one shared shell, centered stage tabs, and a readable garden board. */
body #stage{grid-template-rows:76px minmax(0,1fr) 62px}
#stage .scene-header{position:relative}
#stage .scene-header small{display:none}
#stage #progress{position:absolute;left:50%;bottom:5px;transform:translateX(-50%);max-width:calc(100% - 150px);font-size:.7rem;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stage-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-items:center;padding:7px 12px;background:#173f31e8;border-top:1px solid #8ec59c66;backdrop-filter:blur(10px)}
.stage-tab{grid-column:2;min-height:46px;border:1px solid #f8dc72;border-radius:13px;background:linear-gradient(180deg,#f9dc72,#e7ad36);color:#23422f;font-weight:950;box-shadow:0 5px 14px #102b2166}

#battle{position:relative;background:#143d31}
#battle .scene-header{position:relative;z-index:4;background:linear-gradient(90deg,#173e31f2,#356d4ff2);border-bottom:1px solid #e8d47888}
.battle-content{position:relative;isolation:isolate;display:grid;grid-template-columns:1fr;grid-template-rows:1fr;place-items:center;padding:12px 16px;overflow:hidden}
.battle-content::before{content:"";position:absolute;z-index:-2;inset:0;background:linear-gradient(#12392caf,#12392caf),url("../../assets/animal-sunbeam-garden-cover-general-v3.webp") center 42%/cover no-repeat;filter:saturate(.82)}
.battle-content::after{content:"";position:absolute;z-index:-1;inset:0;background:radial-gradient(circle at 50% 38%,#f9ed9270,transparent 36%),linear-gradient(180deg,transparent 60%,#08261ee0)}
.garden-panel{width:min(100%,680px);display:grid;grid-template-rows:minmax(0,1fr) auto auto;justify-items:center;gap:9px;padding:14px;border:1px solid #f5df85aa;border-radius:28px;background:linear-gradient(155deg,#faffefed,#d8e9bde8);box-shadow:0 18px 50px #071b16aa,inset 0 1px #fff}
.board{position:relative;width:min(calc(100vw - 62px),calc(100svh - 320px),570px);min-width:250px;isolation:isolate;overflow:hidden;border:6px solid #5b843f;border-radius:24px;background:#244f3b;box-shadow:0 10px 28px #173a2d66,inset 0 0 0 2px #d4dc82}
.cell{z-index:1;border-radius:4px}
.cell.beam{box-shadow:inset 0 0 0 2px #fff4a933;filter:brightness(1.05)}
.cell.source,.cell.goal,.cell.mirror{z-index:4}
.cell.goal{background-image:none}
.cell.goal::before{content:"";position:absolute;inset:0;background:url("../../assets/animal-sunbeam-garden-flower-v1.webp") center/contain no-repeat;transform:translateY(-3.5%);pointer-events:none}
.cell.goal.hit::before{background-image:url("../../assets/animal-sunbeam-garden-flower-hit-v1.webp");transform:translateX(11.5%)}
.cell.mirror::after{transition:transform .3s cubic-bezier(.2,.85,.25,1.25),filter .3s ease;transform-origin:center}
.cell.mirror[data-rot="1"]::after{transform:rotate(90deg)}
.cell.mirror.turning[data-rot="0"]::after{transform:rotate(90deg) scale(1.08);filter:drop-shadow(0 0 7px #fff7b8)}
.cell.mirror.turning[data-rot="1"]::after{transform:rotate(180deg) scale(1.08);filter:drop-shadow(0 0 7px #fff7b8)}
.board.is-turning .beam-layer{opacity:1;filter:none}
.beam-layer{position:absolute;z-index:5;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;transition:opacity .2s ease}
.beam-layer polyline{fill:none;stroke-linecap:round;stroke-linejoin:round}
.beam-glow{stroke:#ffd83d;stroke-width:16;opacity:.55;filter:drop-shadow(0 0 7px #fff199)}
.beam-core{stroke:#fff8b8;stroke-width:5;filter:drop-shadow(0 0 3px #fff)}
.board.solved .beam-core{stroke:#fffef0;animation:beamPulse .75s ease-in-out infinite alternate}
.garden-panel #status{min-height:22px;margin:0;color:#234b3d;font-size:.86rem;font-weight:900}
.tools{width:min(100%,420px);display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.tools button{min-height:46px;border:1px solid #789e64;border-radius:13px;background:#fffef0;color:#284d3a;font-weight:900;box-shadow:0 4px 10px #31523a22}
.tools button:active{transform:translateY(1px)}
dialog>div:last-child{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
dialog>div:last-child button{min-width:0;padding-inline:8px}
dialog button:disabled{opacity:.45;cursor:not-allowed}
@keyframes beamPulse{to{stroke-width:7;filter:drop-shadow(0 0 7px #fff)}}

@media(max-width:680px){
  .garden-panel{padding:10px;border-radius:22px}
  .board{width:min(calc(100vw - 44px),calc(100svh - 270px),570px)}
}
@media(max-height:500px) and (orientation:landscape){
  body #stage{grid-template-rows:58px minmax(0,1fr) 54px}
  #stage #progress{bottom:3px;font-size:.64rem}
  .stage-tabs{padding:4px 10px}.stage-tab{min-height:42px}
  .battle-content{grid-template-columns:1fr;grid-template-rows:1fr;justify-content:stretch;padding:6px 10px}
  .garden-panel{place-self:center;width:min(720px,100%);grid-template-columns:minmax(260px,1fr) 210px;grid-template-rows:1fr auto;gap:8px 14px;padding:8px 12px}
  body #battle .board{grid-column:1;grid-row:1/3;width:min(252px,calc(100svh - 82px));min-width:0}
  .garden-panel #status{grid-column:2;grid-row:1;align-self:end}
  .tools{grid-column:2;grid-row:2;width:100%}
}
