@import url('../playful_shared/style.css?v=20261002play1');
body{--accent:#388e84;--ink:#315d60;--soft:#e6f2e8;background:#c4e8e3;color:#315d60}.backdrop{background-color:#b7e3dc;background-size:cover;background-position:center}.backdrop:after{content:'';position:absolute;inset:0;background:#e0f3e878}.app{max-width:1100px;grid-template-rows:70px 66px 49px auto minmax(0,1fr) auto;gap:0}.heading{background:#fffdf1f5;border-radius:22px;padding:6px 18px;box-shadow:0 3px 0 #408e8622}.heading h1{font-size:25px;margin:2px 0}.heading small{font-size:9px;letter-spacing:1.3px}.speech{background:#fffef4;min-height:52px;font-size:19px;line-height:1.3;max-width:740px;box-shadow:0 3px 0 #4c918624}.speech-row{z-index:5}#parts{display:flex;gap:9px;justify-content:center;align-items:center;z-index:3}#parts button{height:44px;min-width:100px;background:#f7fbecdd;border:2px solid #e0ead7;border-radius:16px;font:700 14px system-ui;color:#63847a;padding:5px 14px;box-shadow:0 3px 0 #5c907519}#parts button span{display:inline-grid;place-items:center;width:21px;height:21px;border-radius:50%;background:#e1e9d7;margin-right:4px}#parts button.current{background:#fffce7;border-color:#e7bb69;color:#456966}#parts button.done span{background:#78ac97;color:#fff}#parts button:disabled{opacity:.72}.play-area{display:flex;align-items:center;justify-content:center;min-height:0}.scene{position:absolute;opacity:0;pointer-events:none}#draw-canvas{width:auto;height:auto;max-width:100%;max-height:100%;aspect-ratio:3/2;display:block;touch-action:none;user-select:none;-webkit-user-select:none;border-radius:24px;box-shadow:0 7px 0 #306c6020;outline-offset:3px;cursor:crosshair}#draw-canvas:focus-visible{outline:3px solid #e3b851}body[data-phase=swim] #draw-canvas{cursor:pointer;border:3px solid #e6fff1;box-shadow:0 6px 0 #31827833}footer{padding:6px 0 2px;z-index:4}.tools{min-height:59px;gap:10px;flex-wrap:nowrap}.crayon,.eye-tool{width:51px;height:55px;min-width:44px;min-height:44px;border:2px solid #e3eedc;background:#fffdf1;border-radius:16px;display:grid;place-items:center;padding:5px;box-shadow:0 4px 0 #3b8a7728;position:relative}.crayon span{display:block;width:18px;height:35px;border-radius:3px 3px 5px 5px;background:var(--crayon);clip-path:polygon(0 23%,50% 0,100% 23%,100% 100%,0 100%)}.crayon span:after{content:'';position:absolute;left:17px;right:17px;top:25px;border-top:2px solid #fff9;border-bottom:2px solid #fff9;height:12px}.eye-tool svg{width:34px;height:34px}.crayon[aria-pressed=true],.eye-tool[aria-pressed=true]{border-color:#e6b968;outline:2px solid #fff5c7;outline-offset:1px;transform:translateY(-3px)}.action-row{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:9px;min-height:48px}.action{font:750 17px system-ui;min-height:48px;border-radius:16px;padding:8px 18px;border:2px solid #f5f9e5;background:#fffdf3;color:#458675;box-shadow:0 4px 0 #367c692c}.action.square{width:48px;padding:0;font-size:30px;line-height:1}.main-action{min-width:214px;background:#598f7e;color:#fffef1;border-color:#e0f0cc}.main-action:disabled{background:#a5c3b4;color:#f6fff4;opacity:.85}.main-action span{margin-left:10px}.action:disabled{opacity:.55}.sea-action{height:49px;min-width:132px;border-radius:16px;border:2px solid #eef7df;background:#fffdf1;color:#52816f;font:700 15px system-ui;padding:8px 13px}.sea-action span{font-size:23px;margin-right:5px}.sea-action[aria-pressed=true]{border-color:#e7b769;background:#fff0c8}.bottom-row{max-width:350px;min-height:44px;margin-top:7px}.mini-button{min-width:44px;min-height:44px;background:#fffdf0ef}#progress{font-size:12px;background:#ffffeae6;padding:5px 14px;border-radius:20px}.sound-note{z-index:20;max-width:calc(100vw - 20px)}.art-note{top:142px}
@media(max-width:520px){.app{padding-left:7px;padding-right:7px;grid-template-rows:64px 65px 49px auto minmax(0,1fr) auto}.heading{padding:6px 9px}.heading h1{font-size:20px}.heading small{font-size:8px;letter-spacing:.5px}.speech{font-size:17px;min-height:52px;padding:8px 13px}#parts{gap:6px}#parts button{min-width:88px;font-size:13px;padding:5px 10px}.tools{gap:7px;min-height:56px}.crayon,.eye-tool{width:49px;height:52px}.action-row{gap:8px;margin-top:7px}.main-action{min-width:208px;font-size:16px;padding:8px 10px}.bottom-row{margin-top:6px}#draw-canvas{border-radius:20px}.sound-note{top:65px}.art-note{top:130px}}
@media(max-width:350px){.heading h1{font-size:16px}.heading small{font-size:7px}.crayon,.eye-tool{width:44px;height:48px}.tools{gap:5px}.crayon span:after{left:14px;right:14px}.main-action{min-width:190px;font-size:15px}.action-row{gap:5px}.sea-action{min-width:124px;font-size:13px}#parts button{min-width:80px}}
@media(max-height:650px) and (orientation:portrait){.app{grid-template-rows:55px 54px 46px auto minmax(0,1fr) auto}.heading small{display:none}.heading h1{font-size:17px}.speech{min-height:45px;font-size:15px}.tools{min-height:48px}.crayon,.eye-tool{height:46px}.crayon span{height:29px}.crayon span:after{top:20px}.action-row{margin-top:4px}.action{min-height:44px}.bottom-row{margin-top:3px}footer{padding-top:3px}.art-note{top:112px}}
@media(orientation:landscape) and (max-height:560px){.app{grid-template-columns:minmax(0,1fr) 240px;grid-template-rows:53px 46px 46px auto minmax(0,1fr);padding:0 7px 6px}.topbar{grid-column:1/3;grid-row:1}.heading small{display:none}.heading h1{font-size:19px}.speech-row{grid-column:1/3;grid-row:2}.speech{font-size:16px;min-height:44px;max-width:660px}#parts{grid-column:1/3;grid-row:3}.play-area{grid-column:1;grid-row:5}#notices{grid-column:1/3;grid-row:4}footer{grid-column:2;grid-row:5;padding:2px 3px;align-self:center}.tools{display:grid;grid-template-columns:repeat(3,49px);gap:6px;min-height:0;justify-content:center}.crayon,.eye-tool{width:49px;height:46px}.crayon span{height:28px}.crayon span:after{top:19px}.action-row{gap:4px;flex-wrap:wrap;margin-top:6px}.main-action{min-width:130px;min-height:44px;font-size:12px;padding:5px 6px;order:0}.action.square{width:44px;min-height:44px;order:1}.main-action span{margin-left:3px}.bottom-row{margin-top:5px;display:grid;grid-template-columns:44px 1fr 44px;gap:2px}#progress{font-size:9px;padding:2px;text-align:center}.sea-action{grid-column:1/4;min-width:158px;height:44px;font-size:13px}.sound-note{top:54px}.art-note{top:100px}body[data-phase=swim] .main-action{min-width:178px;font-size:15px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

#notices{display:flex;justify-content:center;gap:6px;z-index:6;min-height:0}#notices .sound-note{position:static;inset:auto;transform:none;min-height:44px;max-width:340px;padding:7px 15px;font:650 12px/1.25 system-ui;flex:0 1 auto;margin:2px 0;background:#fff9df}#notices [hidden]{display:none!important}

#parts button{display:flex;align-items:center;justify-content:center;gap:4px;padding:5px 10px}#parts .part-picture{width:35px;height:27px;flex:0 0 35px}#parts b{font:inherit;font-weight:700}.next-invite{outline:3px solid #efc36a;outline-offset:3px;animation:next-invite 1.5s ease-in-out infinite}@keyframes next-invite{50%{outline-offset:5px;outline-color:#b68c37}}@media(max-width:350px){#parts button{padding:5px 5px;min-width:80px}#parts .part-picture{width:29px;flex-basis:29px}}@media(prefers-reduced-motion:reduce){.next-invite{animation:none!important}}

#parts button.done b::after{content:' ✓';color:#537b61;font-size:.85em}

/* Swimming uses the viewport. Drawing keeps its paper and complete tool set. */
body[data-sea=true] .app{display:block;width:100%;max-width:none;padding:0;pointer-events:none}
body[data-sea=true] .backdrop:after{display:none}
body[data-sea=true] .play-area{position:fixed;inset:0;display:block;z-index:0;pointer-events:auto}
body[data-sea=true] #draw-canvas{width:100%;height:100%;max-width:none;max-height:none;aspect-ratio:auto;border:0;border-radius:0;box-shadow:none;cursor:pointer}
body[data-sea=true] .topbar{position:fixed;top:max(10px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));height:48px;padding:0;z-index:5;pointer-events:none}
body[data-sea=true] .round-button,body[data-sea=true] #mute{width:48px;height:48px;pointer-events:auto}
body[data-sea=true] #mute{border-radius:50%;border:2px solid #fff8e9;background:#fffdf4;box-shadow:0 4px 0 #60544a18;color:var(--accent)}
body[data-sea=true] #mute svg{width:26px;height:26px}
body[data-sea=true] .heading,body[data-sea=true] #parts{display:none}
body[data-sea=true] .speech-row{position:fixed;top:max(10px,env(safe-area-inset-top));left:calc(max(12px,env(safe-area-inset-left)) + 64px);right:calc(max(12px,env(safe-area-inset-right)) + 64px);padding:0;z-index:5;align-items:flex-start;pointer-events:none}
body[data-sea=true] .speech{font-size:16px;min-height:48px;max-width:650px;padding:8px 14px;background:#fffef1ed;pointer-events:auto}
body[data-sea=true] footer{position:fixed;left:50%;bottom:max(12px,env(safe-area-inset-bottom));transform:translateX(-50%);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;width:min(700px,calc(100% - 28px));padding:0;z-index:5;pointer-events:none}
body[data-sea=true] .tools,body[data-sea=true] .action-row{display:contents}
body[data-sea=true] .sea-action,body[data-sea=true] .main-action{width:100%;min-width:0;min-height:52px;height:auto;margin:0;padding:9px 10px;border-radius:18px;font-size:15px;line-height:1.2;pointer-events:auto;order:initial}
body[data-sea=true] .main-action{grid-column:4}
body[data-sea=true] .sea-action{display:flex;align-items:center;justify-content:center;gap:6px;grid-column:auto;grid-row:1}
body[data-sea=true] .sea-action .button-symbol{font-size:22px;margin:0;flex:none}
body[data-sea=true] .sea-action .button-label{font:inherit;margin:0}
body[data-sea=true] .bottom-row{position:absolute;bottom:calc(100% + 7px);left:50%;transform:translateX(-50%);display:flex;width:auto;max-width:none;min-height:0;height:auto;margin:0;pointer-events:none}
body[data-sea=true] #progress{font-size:11px;white-space:nowrap;padding:4px 12px;background:#fffef0ca}
body[data-sea=true] #replay,body[data-sea=true] #again{display:none}
body[data-sea=true] #notices{position:fixed;top:max(76px,calc(env(safe-area-inset-top) + 66px));left:12px;right:12px;z-index:8;pointer-events:none}
body[data-sea=true] #notices button{pointer-events:auto}
@media(max-width:520px){body[data-sea=true] .speech-row{left:68px;right:68px}body[data-sea=true] .speech{font-size:13px;padding:8px 9px;gap:6px}body[data-sea=true] footer{gap:6px;width:calc(100% - 20px)}body[data-sea=true] .sea-action,body[data-sea=true] .main-action{font-size:12px;padding:8px 6px;min-height:52px;border-radius:15px}body[data-sea=true] .sea-action{gap:4px}body[data-sea=true] .sea-action .button-symbol{font-size:19px}}

/* Pick one complete shape, then draw freely on the same paper. */
body[data-sea=false] .app{grid-template-rows:70px 66px 70px auto minmax(0,1fr) auto}
#templates{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;align-items:center;justify-self:center;width:min(680px,100%);z-index:3}
#templates button{min-width:44px;min-height:64px;height:64px;padding:3px 5px;border:2px solid #dfebd9;border-radius:15px;background:#fffdefd9;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#54776c;box-shadow:0 3px 0 #5c907519}
#templates svg{width:62px;max-width:100%;height:37px;display:block}
#templates b{font:700 12px/1.1 system-ui;white-space:nowrap}
#templates button.current{border-color:#dcb15c;background:#fff5d2;box-shadow:0 3px 0 #b19b6640}
body[data-sea=true] #templates{display:none}
@media(max-width:520px){body[data-sea=false] .app{grid-template-rows:60px 58px 65px auto minmax(0,1fr) auto}#templates{gap:4px}#templates button{padding:2px;min-height:59px;height:59px;border-radius:12px}#templates svg{width:49px;height:33px}#templates b{font-size:10px}body[data-sea=false] .speech{font-size:15px;min-height:48px}}
@media(max-width:350px){#templates{gap:3px}#templates b{font-size:9px}body[data-sea=false] .main-action{min-width:174px}}
@media(max-height:650px) and (orientation:portrait){body[data-sea=false] .app{grid-template-rows:55px 52px 65px auto minmax(0,1fr) auto}}
@media(orientation:landscape) and (max-height:560px){body[data-sea=false] .app{grid-template-rows:48px 44px 63px auto minmax(0,1fr)}#templates{grid-column:1/3;grid-row:3;max-width:660px}#templates button{height:58px;min-height:58px}#templates svg{height:32px}#templates b{font-size:11px}}

/* These are real touch buttons, anchored to the chosen swimmer in CSS pixels. */
#fish-actions{position:fixed;left:0;top:0;display:flex;gap:12px;z-index:7;padding:0;touch-action:none;user-select:none;will-change:transform}
#fish-actions[hidden],#restore-fish[hidden]{display:none!important}
#fish-actions button{width:52px;height:52px;min-width:52px;min-height:52px;padding:12px;border:2px solid #e8f4df;border-radius:50%;background:#fffdf2;color:#4e806f;box-shadow:0 3px 0 #356d6533,0 4px 14px #25686120;display:grid;place-items:center;touch-action:none;cursor:pointer}
#fish-actions button:active{background:#e5f3db}
#fish-actions #fish-delete{color:#b86658;border-color:#f4e0cb}
#fish-actions button:focus-visible{outline:3px solid #d6a541;outline-offset:3px}
#fish-actions svg,#restore-fish svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
#notices #restore-fish{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;font-size:14px;pointer-events:auto}
.sea-action:disabled{opacity:.5;cursor:default}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

#feed{touch-action:none;user-select:none;-webkit-user-select:none;background:#fff3ce;border-color:#f6d99b}#feed.feeding{background:#ffe7a5;transform:translateY(-2px)}#feed .food-jar{width:27px;height:31px;flex:none}body[data-sea=true] #feed .button-label{white-space:nowrap}
@media(max-width:520px){body[data-sea=true] .sea-action{flex-direction:column;gap:2px;padding:5px 3px}body[data-sea=true] .sea-action .button-symbol{font-size:19px;line-height:22px}#feed .food-jar{height:24px;width:23px}}
/* The drawing palette stays on two rows; tools and the single finish action
   are separate, so adding colors does not shrink children's touch targets. */
body[data-phase=draw] .tools{display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));width:min(408px,100%);gap:5px;min-height:0;margin:auto}
body[data-phase=draw] .crayon{width:100%;height:44px;min-height:44px;border-radius:12px;padding:3px}
body[data-phase=draw] .crayon span{height:29px;width:17px}body[data-phase=draw] .crayon span:after{display:none}
body[data-phase=draw] .action-row{margin-top:7px;gap:8px;min-height:48px;flex-wrap:nowrap}
body[data-phase=draw] .main-action{min-width:166px;width:min(218px,calc(100% - 108px));font-size:16px}
body[data-phase=draw] .action.square{height:48px;width:48px;min-width:48px;padding:7px;display:grid;place-items:center;border-radius:14px}
#eraser svg{width:31px;height:31px}#eye-tool svg{width:33px;height:33px}
.action[aria-pressed=true]{border-color:#ddb05e;background:#fff0c5;outline:2px solid #fff5c7}
#again svg,#library-button svg{width:26px;height:26px;flex:none}#again{padding:8px}
body[data-phase=draw] .bottom-row{margin-top:3px}body[data-phase=draw] footer{padding-top:5px}
body[data-phase=draw][data-tool=eraser] #draw-canvas{cursor:cell}
body[data-phase=swim] #eye-tool,body[data-phase=releasing] #eye-tool,body[data-phase=swim] #eraser,body[data-phase=releasing] #eraser{display:none}
#save-note{pointer-events:none}
@media(max-width:350px){body[data-phase=draw] .tools{gap:4px}body[data-phase=draw] .main-action{min-width:162px}body[data-phase=draw] .action.square{width:44px;min-width:44px;height:46px;padding:6px}body[data-phase=draw] .action-row{gap:6px}body[data-phase=draw] .bottom-row{margin-top:2px}}
@media(orientation:landscape) and (max-height:560px){
 body[data-sea=false] .app{grid-template-columns:minmax(0,1fr) 300px}
 body[data-phase=draw] footer{padding:0 5px;align-self:center}
 body[data-phase=draw] .tools{grid-template-columns:repeat(6,44px);width:284px;gap:4px}
 body[data-phase=draw] .action-row{gap:6px;margin-top:7px}body[data-phase=draw] .main-action{min-width:154px;font-size:14px;order:2}body[data-phase=draw] .action.square{order:0}
 body[data-phase=draw] .bottom-row{position:fixed;bottom:6px;left:calc((100vw - 300px)/2);transform:translateX(-50%);display:flex;gap:12px;width:104px;z-index:5}
 body[data-phase=draw] .bottom-row #progress{display:none}body[data-phase=draw] .play-area{padding-bottom:50px}
}
#library{position:fixed;z-index:12;bottom:max(10px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(960px,calc(100% - 20px));max-height:calc(100dvh - 90px);border:2px solid #fff7df;border-radius:22px;background:#fffdf0f7;box-shadow:0 -6px 28px #21686f30;padding:8px 12px 10px;color:#446e66}
#library[hidden]{display:none}body[data-library-open=true] footer{visibility:hidden;pointer-events:none}
.library-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;height:44px}
#library-title{font:750 18px system-ui;margin:0}
#library-close{width:44px;height:44px;min-width:44px;border-radius:50%;font:25px system-ui;color:#557970;border:1px solid #d8e8d8;background:#f6f5df;padding:0;box-shadow:none}
#library-help{font:500 13px/1.35 system-ui;margin:3px 0 8px}
#library-strip{display:flex;gap:9px;overflow-x:auto;overflow-y:hidden;padding:3px 3px 9px;touch-action:pan-x;scroll-snap-type:x proximity;scrollbar-color:#a5c4ae transparent;overscroll-behavior-x:contain;min-height:132px}
#library .library-card{width:126px;min-width:126px;min-height:137px;height:137px;padding:7px 6px;border:2px solid #d8e8d9;border-radius:16px;background:#d9f1ed;color:#3b6866;box-shadow:0 3px 0 #649d8726;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;scroll-snap-align:start;touch-action:pan-x;user-select:none;-webkit-user-select:none}
.library-item{flex:0 0 126px;display:flex;flex-direction:column;align-items:flex-end;gap:3px;scroll-snap-align:start}
#library .library-delete{width:44px;height:44px;min-width:44px;min-height:44px;display:grid;place-items:center;padding:10px;border:1px solid #edcfb8;border-radius:50%;background:#fff5e7;color:#b36254;box-shadow:none;touch-action:pan-x}
.library-delete svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
#library button:focus-visible{outline:3px solid #d6a541;outline-offset:1px}
.library-card canvas{display:block;width:110px;height:71px;pointer-events:none}.library-card b{font:700 12px/1.2 system-ui;min-height:28px;display:flex;align-items:center;justify-content:center}.library-card span{font:600 10px system-ui;color:#568577}
#library-ghost{position:fixed;z-index:30;left:0;top:0;width:120px;height:77px;border-radius:16px;background:#e4f4eebf;box-shadow:0 5px 16px #286d6240;pointer-events:none;touch-action:none;will-change:transform}
@media(orientation:landscape) and (max-height:560px){#library{max-height:none;width:min(860px,calc(100% - 20px));padding:5px 10px 6px}.library-heading{height:44px}#library-help{position:absolute;left:170px;right:65px;top:15px;margin:0;font-size:12px}#library-strip{padding-bottom:4px;min-height:97px}#library .library-card{min-height:97px;height:97px;min-width:123px;width:123px;gap:1px;padding:3px 5px}.library-card canvas{width:84px;height:54px}.library-card b{min-height:17px;font-size:11px}.library-card span{font-size:9px}}

/* Long species names stay inside six toddler-sized cards. */
#templates button b{white-space:normal;overflow-wrap:anywhere;font-size:11px;line-height:1.05;min-height:24px;display:flex;align-items:center;justify-content:center;width:100%}
@media(max-width:600px){#templates button b{font-size:9px;min-height:21px}#templates button svg{height:29px}}
@media(max-width:350px){#templates button b{font-size:8.5px}#templates button{padding-left:2px;padding-right:2px}}

@media(orientation:landscape) and (max-height:560px){.library-item{flex-basis:123px}}
