/* Fix My Fail 0.4.0 — premium mobile art direction inspired by approved concept.
   All controls and physics continue to use the original accessible game structure. */
:root {
  --paper:#edf3fa; --ink:#1c2b4a; --muted:#6e7690;
  --orange:#ff7d32; --orange-dark:#d95523;
  --line:#d9dfeb; --white:#fffdfa;
  font-family:ui-rounded,"Avenir Next",Avenir,"Trebuchet MS",system-ui,sans-serif;
}
html{background:#e5edf8}
body{background:linear-gradient(180deg,#b9d9ff 0px,#dceaff 178px,#f8f6f0 540px,#f9f6f1 100%);min-width:280px;overscroll-behavior-y:none;overflow-x:hidden;color:#1d2946}
button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid #008dd2;outline-offset:3px}
.site-header{max-width:1180px;padding-top:22px;padding-bottom:12px;position:relative;z-index:1}
.brand{color:#1c2d58;gap:10px;letter-spacing:.9px;font-size:10px;text-shadow:0 1px 0 rgba(255,255,255,.9);transform:none}
.brand>span:last-child{font-weight:1000;line-height:1.08;letter-spacing:1.2px;font-size:13px}
.brand strong{color:#ff8535;font-weight:1000;font-size:26px;letter-spacing:1.3px;-webkit-text-stroke:.65px #21396a;text-shadow:1px 2px 0 #fff0d0,2px 3px 0 #5168a7}
.brand-box{width:50px;height:48px;border-radius:11px;border:3px solid #253452;background:linear-gradient(130deg,#ffd07c 5%,#ff922f 45%,#e35c1f 100%);box-shadow:3px 5px 0 #16274477,0 8px 16px #183a6455;transform:rotate(-12deg)}
.brand-box:after{content:"";position:absolute;left:47%;width:22%;top:0;bottom:0;background:#ffe4a2b8;transform:skew(4deg)}
.brand-box b{z-index:2;letter-spacing:6px;left:9px;bottom:0px;color:#21334a;font-size:29px}
.brand-box i{z-index:3;left:17px;top:-1px;background:#ffe8b0;width:8px;height:15px;transform:rotate(0deg);opacity:.8}
.header-right{gap:10px}
.language-switch{border:2px solid #ffffffb5;background:#fcfaffc9;padding:4px;border-radius:19px;box-shadow:0 6px 20px #3251751b}
.language-switch button{border-radius:13px;color:#8c8fb0;min-width:48px}
.language-switch button[aria-pressed="true"]{color:#ee5b21;background:#fff;box-shadow:0 2px 8px #364a6b23}
.game-shell{background:#fffdf8;border:2px solid #e7e3dc;border-radius:28px;box-shadow:0 20px 48px rgba(26,47,86,.18),0 6px 0 #aab9c635;isolation:isolate;overflow:hidden}
.game-heading{display:flex;gap:12px;padding:13px 15px 12px;align-items:center;position:relative;background:linear-gradient(150deg,#fffefa,#fff7f1);min-height:97px}
.game-heading>div:nth-child(2){flex:1;min-width:0;align-self:center}
.game-heading h2{font-weight:1000;font-size:15px;letter-spacing:-.35px;line-height:1.23;color:#151f3f;margin:4px 0 11px;white-space:normal;overflow:visible;text-overflow:clip;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;max-height:2.46em}
.game-heading p{color:#626d99;font-size:9px;font-weight:1000;letter-spacing:1.1px}
.game-heading>.icon-button{width:60px;height:66px;min-width:60px;flex:0 0 60px;border-radius:14px;background:linear-gradient(165deg,#64789c,#263451 65%,#16283b);box-shadow:inset 0 1px 0 #ffffff7a,0 5px 0 #17264233,0 9px 14px #223c5b36;overflow:hidden;border:2px solid #f5eedf;position:relative}
.game-heading>.icon-button svg{display:none}
.world-thumb-emoji{font-family:"Apple Color Emoji","Segoe UI Emoji",sans-serif;position:relative;z-index:2;font-size:30px;line-height:1;filter:drop-shadow(0 3px 3px rgba(0,0,0,.27))}
.game-shell[data-world="0"] .game-heading>.icon-button{background:linear-gradient(160deg,#cdeefa,#63b7d6 53%,#4d8e7a 100%)}
.game-shell[data-world="1"] .game-heading>.icon-button{background:linear-gradient(160deg,#b4f5dc,#4dba9c 53%,#2b6075 100%)}
.game-shell[data-world="2"] .game-heading>.icon-button{background:linear-gradient(160deg,#d1cafa,#727ebb 53%,#38436c 100%)}
.game-shell[data-world="3"] .game-heading>.icon-button{background:linear-gradient(160deg,#ffe6cc,#f3a367 53%,#bf557f 100%)}
.game-shell[data-world="4"] .game-heading>.icon-button{background:linear-gradient(160deg,#b1e9fc,#438dbf 53%,#294e87 100%)}
.game-shell[data-world="5"] .game-heading>.icon-button{background:linear-gradient(160deg,#a5c5f5,#3b618b 45%,#111e36 100%)}
.game-shell[data-world="6"] .game-heading>.icon-button{background:linear-gradient(160deg,#ffdf97,#e9a14d 53%,#b95872 100%)}
.game-heading>.icon-button:before{content:"";position:absolute;left:-10px;right:0;bottom:0;height:24px;background:linear-gradient(155deg,#223f50,#172e42);clip-path:polygon(0 70%,15% 13%,40% 50%,65% 5%,84% 65%,100% 25%,100% 100%,0 100%)}
.game-heading>.icon-button:after{content:"";position:absolute;inset:2px;border-radius:12px;border:1px solid #ffffff5c;pointer-events:none}
.level-counter{align-self:flex-start;padding-top:5px;color:#1e2a4a;font-size:23px;font-weight:1000;font-variant-numeric:tabular-nums}
.level-counter span{color:#7c8199;font-size:11px}
.journey-meter{height:10px;width:min(100%,166px);border-radius:20px;background:#e5e7e5;box-shadow:inset 0 2px 3px #63798a31;overflow:hidden}
.journey-meter-fill{height:100%;border-radius:20px;background:linear-gradient(180deg,#6efa65,#28c84d 65%,#13a448);box-shadow:inset 0 2px 1px #ffffff9c,0 0 7px #25cc5140;min-width:0;width:0;transition:width .4s ease}
.challenge-strip{background:#fffdfa;min-height:35px;gap:7px;padding:2px 16px 10px;border-bottom:3px solid #eae4dd}
.difficulty-badge{border:1px solid #ebd7fa;background:#f5e1ff;color:#8635bb;padding:7px 9px;border-radius:13px;gap:5px;box-shadow:0 2px 0 #deb5f688;font-size:10px}
.difficulty-badge .difficulty-dots{font-size:8px;letter-spacing:0}
.difficulty-badge[data-difficulty="1"]{color:#2a8757;background:#e6f8df;border-color:#c2eaca}
.difficulty-badge[data-difficulty="2"]{color:#956f1f;background:#fff3ce;border-color:#ffe2aa}
.difficulty-badge[data-difficulty="3"]{color:#b3631f;background:#fff0de;border-color:#ffc98a}
.difficulty-badge[data-difficulty="4"]{color:#853eab;background:#f5ddff;border-color:#e9c1ff}
.difficulty-badge[data-difficulty="5"]{color:#bb3252;background:#ffe1e9;border-color:#f7b9c9}
.checkpoint-count{color:#886019;background:#fff5d3;border:1px solid #ffe4a4;box-shadow:0 2px 0 #e9d19e88;padding:7px 11px;border-radius:11px;font-size:10px}
.checkpoint-count.complete{color:#147648;background:#ddffde}
.mechanic-label{color:#75829e;font-size:9px;font-weight:900;letter-spacing:.75px}
.game-stage{height:500px;max-height:none;background:#385878;overflow:hidden;position:relative}
.game-stage canvas{height:100%;width:auto;max-width:100%;aspect-ratio:3/4;display:block;touch-action:none;user-select:none}
.stage-status{background:linear-gradient(145deg,#1c2b47ed,#273859e8);border:1px solid #d4eaff72;box-shadow:0 3px 10px #11223b5c;backdrop-filter:blur(4px);color:#fffdf7;border-radius:24px;font-size:9px;letter-spacing:.1px;top:12px;left:15px;padding:9px 12px;max-width:70%;text-shadow:0 1px 1px #0f203b}
.status-dot{background:#ffbb64;box-shadow:0 0 8px #ffd291}
.watch-fail{top:13px;right:10px;color:#fff8e5;background:#1d33499c;border:1px solid #d1e8fe75;box-shadow:0 3px 8px #1a304055;font-size:9px;min-height:31px;padding:6px 8px}
.watch-fail svg{width:12px;color:#ffce81}
.running-pill{color:#fff;background:#263c61d9;box-shadow:0 6px 17px #11223966}
.game-advice{display:flex;align-items:center;gap:10px;background:linear-gradient(145deg,#fffdf7,#fff5e7);border:1px solid #efe6d9;border-radius:16px;padding:9px 11px;margin:11px 12px 0;box-shadow:0 2px 7px #9b78491a;font-size:11px;line-height:1.4;color:#4e5772;min-height:41px}
.game-advice-icon{font-size:22px;line-height:1;filter:drop-shadow(0 2px 2px #caa95e55);flex:0 0 26px}
.route-note{background:#ecf6fc;padding:8px 15px;color:#4f667d;line-height:1.4;border-color:#d4e2ee;font-size:10px}
.coach-panel{margin:10px 12px 0;border-radius:15px;background:#fff0d9;border:1px solid #fbd3ab}
.coach-panel p{font-size:11px}
.game-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:7px 9px;padding:11px 13px 12px;background:#fffdf9}
.adjust-row{display:contents}
.selection-label{grid-row:1;grid-column:1;min-width:0;padding-left:7px;position:relative}
.selection-label:before{content:"";display:block;width:22px;height:9px;position:absolute;left:2px;top:-7px;transform:rotate(-17deg);border-radius:4px;background:linear-gradient(180deg,#ffd388,#f07a2d);border:1px solid #c96227;box-shadow:1px 2px 0 #b8643c5c}
.selection-label #selected-label{display:block;color:#172c4e;font-weight:1000;font-size:10px;letter-spacing:.4px;margin:9px 0 3px 27px}
.selection-label #move-label{color:#828fa2;font-size:9px;display:block;margin-left:27px}
.precision-row{grid-row:1;grid-column:2;gap:5px;margin:0;justify-content:flex-end}
.precision-row .text-button{background:linear-gradient(180deg,#fffefa,#f5f0e8);border:1px solid #dfd7d0;border-radius:12px;padding:7px 8px;min-height:37px;box-shadow:0 2px 0 #d8d4d0;white-space:nowrap;font-size:10px;color:#435779}
.precision-row .text-button svg{width:13px;height:13px}
.precision-row #select-next{font-size:9px;padding:7px 6px}
.rotation-controls{grid-row:2;grid-column:1;display:flex;align-items:center;gap:5px;min-width:0;justify-content:space-between}
.rotation-controls .rotate-button{background:linear-gradient(180deg,#fffefa,#f0ece6);border:1px solid #e2ddd8;border-radius:13px;box-shadow:0 3px 0 #d8d5d4;min-width:43px;width:43px;min-height:44px;height:44px;color:#2f4473;font-size:26px;font-weight:700}
.rotation-controls #angle-label{flex:1;text-align:center;color:#1a2d56;background:linear-gradient(150deg,#f1eef0,#f7f3ed);border-radius:13px;min-width:53px;min-height:44px;display:flex;align-items:center;justify-content:center;font-size:19px;font-weight:1000;font-variant-numeric:tabular-nums}
.reset-button{grid-row:2;grid-column:2;min-width:44px;width:44px;min-height:44px;height:44px;background:#f2f0ec;border:1px solid #e3ddd6;box-shadow:0 2px 0 #d7d1ca;border-radius:13px;color:#31496e}
.precision-panel{grid-column:1/-1;background:#f2f5fb;border:1px solid #dce5f0;margin:3px 0 0}
.main-actions{grid-column:1/-1;margin:3px 0 0}
.primary-button#run-button{min-height:61px;border-radius:17px;border:2px solid #ee5a15;background:linear-gradient(180deg,#ffab2c 0%,#ff8517 22%,#fc6416 75%,#ee441b 100%);box-shadow:inset 0 3px 2px #fff7a9a8,inset 0 -3px 0 #bf3d1a7c,0 5px 0 #c54f25,0 9px 18px #df743e56;color:#fff9e5;font-size:24px;font-weight:1000;letter-spacing:-.4px;text-shadow:0 2px 0 #ad421c,0 4px 5px #bb421d9c;transition:transform .12s,box-shadow .12s,filter .12s}
.primary-button#run-button:before{content:"✦";color:#ffe98a;font-size:14px;position:absolute;left:10%;top:12px;text-shadow:0 0 9px #fff39b}
.primary-button#run-button:after{content:"✦";color:#fff7a4;font-size:17px;position:absolute;right:9%;bottom:9px;text-shadow:0 0 9px #fff39b}
.primary-button#run-button svg{width:26px;height:26px;color:#ffec9a;filter:drop-shadow(0 2px 1px #af4919)}
.primary-button#run-button:active:not(:disabled){transform:translateY(3px);box-shadow:inset 0 2px 2px #fff6bc8c,0 2px 0 #b9431c}
.primary-button#run-button:not(:disabled):hover{filter:saturate(1.08) brightness(1.045)}
.primary-button#run-button.coach-target{outline:3px solid #ffca62}
.button-spark{color:#ffe58c;text-shadow:0 0 14px #ffeda1}
.help-row{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:3px}
.help-row button{display:flex;justify-content:center;align-items:center;gap:4px;position:relative;min-width:0;min-height:44px;font-weight:850;font-size:10px;padding:8px 5px 8px 6px;border:1px solid #f0e3d7;border-radius:15px;background:linear-gradient(165deg,#fffefa,#ffebcc);box-shadow:0 3px 0 #eadbd0;color:#293f62}
.help-row button svg{width:21px;height:21px;color:#f49d0c;stroke-width:2.1}
.help-row button#extra-button{background:linear-gradient(145deg,#fcfdff,#e0efff);border-color:#dceaf7}
.help-row button#extra-button svg{color:#177edf}
.help-row button#skip-button{background:linear-gradient(145deg,#fafff8,#e3f7e1);border-color:#e0eddd}
.help-row button#skip-button svg{color:#12a65c}
.help-row button span[id$="-count"]{margin-left:1px;background:#353b5c;color:#fff;border-radius:50%;min-width:19px;height:19px;display:grid;place-items:center;font-size:9px;position:static}
.help-row button:active:not(:disabled){transform:translateY(2px)}
.game-nav{background:linear-gradient(180deg,#fffdfa,#fcf8f7);border-top:1px solid #f0e7e3;grid-template-columns:repeat(5,minmax(0,1fr));padding:8px 7px 9px;gap:5px}
.game-nav button{font-size:10px;font-weight:800;color:#72758f;display:flex;align-items:center;flex-direction:column;gap:4px;min-height:52px;padding:5px 4px;line-height:1.25;border-radius:14px}
.game-nav button svg{width:21px;height:21px;stroke-width:2.2}
.game-nav button.active{color:#f4631e;background:#fff1e4;box-shadow:inset 0 1px 0 #fff2dc}
.game-nav button.active svg{color:#f4631e}
.site-footer{color:#65768a;font-size:10px;letter-spacing:.1px}
.site-footer #save-status i{background:#33b77a}
.modal{background:linear-gradient(155deg,#fffefa,#fcf8f2);border-color:#efe9dd;box-shadow:0 25px 85px #102a5575}
.modal h2{color:#162642}
.modal .primary-button{background:linear-gradient(180deg,#ff9b3a,#f86b20);box-shadow:0 3px 0 #d45a22;color:#fff8eb}
.journey-world{box-shadow:0 5px 12px #46608116;border:1px solid #dbe2ed}
.journey-world[open] summary{background:linear-gradient(150deg,#faf9f2,#eef4fb)}
.journey-world .level-button{box-shadow:0 3px 0 #d6d6df;border:1px solid #d4dce6}
.journey-world .level-button.current{box-shadow:0 3px 0 #e78242}
.result-content .result-emoji{filter:drop-shadow(0 7px 6px #fcb44b70)}
@media (min-width:701px) {
 .app-layout{grid-template-columns:1fr 448px 1fr;gap:26px;max-width:1310px}
 .game-stage{height:525px}
 .game-heading{min-height:98px}
 .game-shell{max-width:500px;margin:0 auto;width:100%}
 .site-header{max-width:1310px}
}
@media (max-width:1050px) and (min-width:701px){
 .app-layout{grid-template-columns:1fr 430px;gap:22px;max-width:820px}
 .game-shell{width:100%}
}
@media(max-width:700px){
 .site-header{padding:calc(12px + env(safe-area-inset-top,0px)) 16px 11px;max-width:500px}
 .brand{gap:7px}
 .brand-box{height:39px;width:39px;border-width:2px;border-radius:10px}
 .brand-box b{left:7px;font-size:23px;letter-spacing:4px}
 .brand-box i{left:13px;width:6px;height:12px}
 .brand>span:last-child{font-size:8px;line-height:1.1}
 .brand strong{font-size:21px}
 .language-switch{padding:3px;border-radius:16px}
 .language-switch button{min-width:36px;min-height:35px;font-size:10px;padding:7px 9px}
 .app-layout{display:block;padding:0 10px;margin:5px auto 0;max-width:440px}
 .game-shell{border-radius:25px}
 .game-heading{padding:11px 11px 9px;min-height:83px;gap:9px}
 .game-heading>.icon-button{width:54px;min-width:54px;height:59px}
 .world-thumb-emoji{font-size:25px}
 .game-heading p{font-size:8px;letter-spacing:.7px}
 .game-heading h2{font-size:13px;margin:4px 0 7px}
 .level-counter{font-size:23px}
 .level-counter span{font-size:9px}
 .journey-meter{height:8px;max-width:146px}
 .challenge-strip{padding:2px 11px 10px;min-height:34px}
 .difficulty-badge{padding:5px 7px;font-size:9px}
 .checkpoint-count{padding:5px 8px;font-size:9px}
 .mechanic-label{font-size:8px}
 .game-stage,.precision-open .game-stage,.guide-layout .game-stage{height:clamp(390px,52dvh,465px);min-height:390px;max-height:none}
 .game-stage canvas{width:auto;height:100%;max-width:100%}
 .stage-status{top:9px;left:10px;padding:7px 9px;max-width:61%;font-size:8px}
 .watch-fail{right:7px;top:8px;max-width:108px;padding:6px;font-size:8px;min-height:29px}
 .game-advice{margin:8px 10px 0;font-size:10px;padding:7px 9px;min-height:37px;gap:7px}
 .game-advice-icon{font-size:19px;flex-basis:22px}
 .coach-panel{display:none!important}
 .game-controls{padding:9px 10px 10px;gap:7px 6px}
 .selection-label{padding-left:0}
 .selection-label #selected-label{margin-left:26px;font-size:9px;margin-top:7px}
 .selection-label #move-label{margin-left:26px;font-size:8px}
 .precision-row .text-button{padding:5px 7px;min-height:33px;font-size:9px}
 .rotation-controls .rotate-button,.reset-button{min-width:41px;width:41px;height:41px;min-height:41px}
 .rotation-controls #angle-label{min-height:41px;font-size:17px}
 .primary-button#run-button{min-height:55px;font-size:21px;border-radius:15px}
 .help-row button{min-height:41px;font-size:9px;padding:5px 3px}
 .help-row button svg{width:17px;height:17px}
 .help-row button span[id$="-count"]{min-width:17px;height:17px;font-size:8px}
 .game-nav{padding:6px 6px 7px}
 .game-nav button{min-height:45px;font-size:9px;padding:5px 3px}
 .game-nav button svg{width:18px;height:18px}
 .site-footer{padding:7px 10px calc(11px + env(safe-area-inset-bottom,0px));margin:1px auto 0;font-size:9px}
}
@media(max-width:370px){
 .game-heading{gap:5px}
 .game-heading>.icon-button{width:45px;min-width:45px;height:54px}
 .game-heading h2{font-size:12px}
 .game-heading p{font-size:7px}
 .game-stage,.precision-open .game-stage,.guide-layout .game-stage{height:clamp(365px,50dvh,420px);min-height:365px}
 .stage-status{font-size:7px;left:6px;max-width:65%}
 .watch-fail{font-size:7px;max-width:90px}
 .precision-row .text-button{min-height:30px;padding:5px}
 .precision-row #select-next{font-size:8px;padding:5px}
 .help-row button{font-size:8px}
}
@media(prefers-reduced-motion:reduce){
 .journey-meter-fill,.primary-button#run-button,.help-row button{transition:none!important}
}
