/* The result page uses the approved navy, cream and gold palette. */
.modal:has(.result-screen){max-width:470px}
.result-screen{color:#244456;text-align:center}
.result-screen .result-emoji{width:70px;height:70px;margin:0 auto 10px;border:3px solid #fff0b1;border-radius:24px;background:linear-gradient(145deg,#ffe9a2,#f6bd4f);color:#855315;box-shadow:inset 0 3px #fff7d7,0 6px #b78637,0 11px 20px #65533322;font-size:40px;line-height:64px}
.result-screen.is-loss .result-emoji{background:linear-gradient(145deg,#daf6ed,#8ed9c5);border-color:#e7fff8;color:#236354;box-shadow:inset 0 3px #f1fffc,0 6px #388f81,0 11px 20px #234b3b22}
.result-screen h2{font-size:clamp(25px,6.4vw,33px);line-height:1.12;color:#1c425b;text-shadow:none!important;margin:15px 0 8px}
.result-screen>p{color:#3e5968;text-shadow:none!important;font-size:14px;line-height:1.5;margin:10px 0}
.result-screen .result-stars{margin:7px 0 12px}
.result-screen .score-celebration{margin:12px 0;padding:12px;background:#eff6ed;border:1px solid #d2e1d3;box-shadow:inset 0 2px #fff;border-radius:18px}
.result-screen .score-celebration strong{font-size:23px;color:#244d60;text-shadow:none}
.result-screen .score-celebration span{font-size:12px;color:#51675d;text-shadow:none}
.result-screen .score-celebration b{color:#704e16;text-shadow:none;font-size:16px}
.result-screen #result-main{width:100%;min-height:54px;font-size:17px;line-height:1.2;margin:13px 0 10px}
.result-screen #result-main svg{width:19px;height:19px;vertical-align:middle}
.result-screen>#result-retry,.result-screen>#result-hint{min-height:44px;font-size:13px;width:100%;margin:5px 0}
.result-screen>#result-levels{display:block;min-height:44px;margin:2px auto 4px;font-size:13px;color:#305f73}
.result-help{margin:12px 0 20px;padding-top:18px;border-top:1px solid #d8dfd0;text-align:left}
.result-help-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
.result-help-heading>span{font-size:34px;filter:drop-shadow(0 3px 2px #29485225)}
.result-help-heading small{font-size:10px;letter-spacing:1.2px;font-weight:800;color:#587360}
.result-help h3{font-size:20px;line-height:1.2;color:#244d60;margin:5px 0}
.result-help-note{font-size:12px;line-height:1.45;color:#526575;text-shadow:none!important;margin:8px 0 12px}
.result-tool-list{display:grid;gap:13px}
.result-tool{display:grid;grid-template-columns:44px minmax(0,1fr);gap:5px 10px;padding:13px 12px;border:1px solid #d4d9c9;border-radius:20px;background:linear-gradient(145deg,#fffefa,#f3f2e3);box-shadow:inset 0 2px #fff,0 4px #d9daca,0 8px 15px #3d5b5020}
.result-tool-icon{width:43px;height:43px;display:grid;place-items:center;border-radius:14px;background:linear-gradient(#e3f7ef,#c5e9dd);border:1px solid #c1dbcf;font-size:27px;box-shadow:inset 0 2px #ffffffa6,0 3px #a4caba}
.result-tool h4{font-size:16px;line-height:1.25;margin:0 0 4px;color:#23495a;text-shadow:none}
.result-tool-copy p{font-size:12px;line-height:1.4;color:#435f6b;margin:0 0 3px;text-shadow:none!important}
.result-tool-copy small{font-size:11px;color:#586e60;font-weight:650;text-shadow:none!important}
.result-tool-actions{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap;margin-top:7px}
.result-tool-actions button{min-height:44px;min-width:0;flex:1;padding:9px 8px;border-radius:13px;font-family:inherit;font-size:12px;font-weight:800;line-height:1.2;cursor:pointer;text-shadow:none!important}
.result-tool-actions .result-buy{border:1px solid #ca9b4b;background:linear-gradient(#ffe7a3,#ffc45d);color:#64451c;box-shadow:inset 0 2px #fff3c5,0 3px #bd8738}
.result-tool-actions .result-coin{border:1px solid #b6ced0;background:linear-gradient(#f3fcff,#d3edf2);color:#2d5668;box-shadow:inset 0 2px #fff,0 3px #8fb1bb}
.result-tool-actions .result-use{flex-basis:100%;border:1px solid #76bda2;background:linear-gradient(#bdf1d6,#6ed0ab);color:#205b48;box-shadow:inset 0 2px #eafff1,0 3px #4c9f83}
.result-tool-actions button:disabled{background:#e7ede7;color:#5a6e63;border:1px solid #cad5cc;box-shadow:none;cursor:default}
.result-wallet{font-size:13px;color:#3f6254;margin:17px 0 8px;text-align:right}
@media(max-width:360px){.result-screen #result-main{font-size:15px}.result-tool{padding:11px 9px}.result-tool-actions{gap:7px}.result-tool-actions button{font-size:11px}}

/* Result copy must stay legible above both the map and the playfield. */
.modal .result-content{color:#203f53}
.modal .result-content :is(h2,h3,h4,p,small,strong,b,button,.result-reward,.daily-result-date,.score-celebration span){text-shadow:none!important;-webkit-text-stroke-width:0!important;-webkit-text-fill-color:currentColor!important}
.modal .result-content :is(h2,h3,h4){color:#173c52!important;letter-spacing:-.3px}
.modal .result-content p,.modal .result-content .daily-result-date{color:#354f60!important;font-size:14px;line-height:1.55}
.modal .result-content .result-reward{color:#214f3c!important;background:#e7f4e8;border:1px solid #adcdb3;font-size:14px;font-weight:750;line-height:1.5;padding:12px}
.modal .result-content .score-celebration{background:#eff6ed;color:#234754}
.modal .result-content .score-celebration strong{color:#1b4055!important}
.modal .result-content .score-celebration span{color:#3a594d!important;font-size:13px}
.modal .result-content .score-celebration b{color:#624313!important;font-size:16px}
.modal .result-content .daily-summary :is(strong,small){color:#25495c!important}
.modal .result-content .result-help :is(small,.result-help-note){color:#3e5d52!important}
.modal .result-content .text-button{color:#28566c!important;font-size:13px}

/* The brief delivery banner sits over the playfield, outside the result modal. */
#result-preview{color:#173c52!important;background:#fff8e6!important;-webkit-text-fill-color:currentColor!important;-webkit-text-stroke:0!important;text-shadow:none!important;max-width:calc(100% - 24px);white-space:normal;text-align:center;font-size:clamp(20px,6vw,26px);line-height:1.25;border:2px solid #e1bd6b;box-shadow:0 4px 0 #b58b40,0 12px 30px #173c5230}


/* Result ceremony — same cream/navy/gold identity, one finite animation per result. */
.result-screen .outcome-hero{position:relative;isolation:isolate;width:150px;height:128px;margin:0 auto 4px;pointer-events:none}
.outcome-aura{position:absolute;inset:2px 0 -2px;border-radius:50%;background:radial-gradient(ellipse,#ffe8a680 0%,#ffe8a630 45%,transparent 72%)}
.outcome-orbit{position:absolute;inset:8px 19px 8px;border:1px solid #d6ab5860;border-radius:50%;box-shadow:0 0 0 8px #eaca8320}
.outcome-medallion{position:absolute;inset:16px 29px 20px;border-radius:28px;overflow:hidden;display:grid;place-items:center;color:#86521a;background:linear-gradient(145deg,#fff5cc 0%,#ffdc7a 44%,#e8ad43 100%);border:2px solid #fff6d7;box-shadow:inset 0 2px 1px #fffefa,inset 0 -4px 7px #b7732520,0 5px 0 #bd8633,0 14px 24px #7c5b2926}
.outcome-medallion>svg{width:68px;height:68px;position:relative;overflow:visible;filter:drop-shadow(0 1px 0 #fff6d7)}
.outcome-check-disc{fill:#fff4ca;stroke:#bd8936;stroke-width:1.5}
.outcome-check{stroke:#426b46;stroke-width:3.5}
.outcome-star{fill:#9b6225;stroke-width:1}
.outcome-sheen{position:absolute;inset:-25% 20%;background:linear-gradient(90deg,transparent,#fff9e5b0,transparent);transform:translateX(-160%) rotate(25deg);opacity:0;pointer-events:none}
.outcome-spark{position:absolute;color:#b27e28;font-size:19px;font-style:normal;text-shadow:0 1px #fff;line-height:1}
.outcome-spark.spark-a{left:11px;top:34px}.outcome-spark.spark-b{right:12px;top:63px;font-size:14px}.outcome-spark.spark-c{right:29px;top:8px;font-size:23px}
.outcome-loss .outcome-medallion{color:#386e70;background:linear-gradient(145deg,#f0fbf6,#c8e8dc 50%,#93c8c1);border-color:#effff6;box-shadow:inset 0 2px #fff,0 5px 0 #669e98,0 14px 24px #355d5724}
.outcome-loss .outcome-aura{background:radial-gradient(ellipse,#b5dedc70,transparent 70%)}
.outcome-loss .outcome-orbit{border-color:#7db4ad60;box-shadow:0 0 0 8px #9ccfc31c}
.outcome-loss .outcome-spark{display:none}
.outcome-finale .outcome-medallion{border-radius:50%;background:linear-gradient(140deg,#fffce5,#ffdf7f 42%,#dca13b)}
.outcome-finale .outcome-orbit{border:2px double #cc9c48;box-shadow:0 0 0 5px #fff2c2,0 0 0 6px #d8b36a66}
.modal .result-screen .outcome-kicker{margin:5px 0 7px;font-size:10px;font-weight:850;letter-spacing:1.8px;color:#856128!important;line-height:1.5;text-transform:uppercase}
.modal .result-screen.is-loss .outcome-kicker{color:#3d7170!important}
.result-screen:has(.outcome-hero) h2{margin-top:5px}
.result-screen:has(.outcome-hero) .result-stars svg{filter:drop-shadow(0 2px 0 #c38d31);width:35px;height:35px}
.result-screen:has(.outcome-hero) .result-stars svg.empty{filter:none}
.result-screen.is-complete .score-celebration{border-color:#d7b777;background:linear-gradient(135deg,#fff9df,#f5ecd2)}
@media(max-height:650px){.result-screen .outcome-hero{height:108px;width:130px}.outcome-medallion{inset:12px 25px 17px;border-radius:24px}.outcome-medallion>svg{width:57px;height:57px}.outcome-orbit{inset:4px 14px 5px}}
@media(prefers-reduced-motion:reduce){.outcome-sheen{display:none}}

.outcome-streak{display:flex;align-items:center;gap:12px;text-align:left;padding:13px 15px;margin:14px 0;border:1px solid #d4b16c;border-radius:18px;background:linear-gradient(135deg,#173d51,#275568);box-shadow:inset 0 1px #ffffff20,0 5px 15px #173d5118}.outcome-streak-badge{flex:0 0 42px;height:42px;display:grid;place-items:center;border-radius:50%;background:linear-gradient(145deg,#fff2ba,#edb74e);border:2px solid #fff2b7;color:#6d4719;font-size:23px;font-weight:900;box-shadow:0 3px #ac7d34}.modal .result-screen .outcome-streak small{display:block;color:#f5dba1!important;font-size:9px;letter-spacing:1.7px;font-weight:800;margin:0 0 4px}.modal .result-screen .outcome-streak strong{display:block;color:#fff6dd!important;font-size:16px;line-height:1.35}

/* Two rescue controls remain now that level skipping is removed. */
.help-row:not(.daily-help){grid-template-columns:repeat(2,minmax(0,1fr))}
.immersive-game .help-row:not(.daily-help){grid-template-columns:repeat(2,minmax(0,1fr))}


/* Boxy Twist 90: persistent, thumb-size primary action on result, daily result
   and next-level preparation. Other modals and the locked game art are untouched. */
.modal.has-primary-footer,
.immersive-game .modal.has-primary-footer {
  display:flex;flex-direction:column;
  height:min(690px,calc(100dvh - var(--safe-top,0px) - var(--safe-bottom,0px) - 26px));
  max-height:100%;overflow:hidden;overscroll-behavior:contain;
}
.modal.has-primary-footer > #modal-content {
  flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
#modal-primary-footer {
  display:block;flex:0 0 auto;padding:11px 5px 5px;
  border-top:1px solid #d9c6a1;
  background:linear-gradient(180deg,#fff8e7,#ffefd2);
  box-shadow:0 -5px 14px #3a271b13;
}
#modal-primary-footer > .primary-button,
.immersive-game #modal-primary-footer > .primary-button {
  width:100%;min-height:58px;height:auto;margin:0!important;
  padding:14px 12px;font-size:clamp(16px,4.6vw,19px);
  line-height:1.2;letter-spacing:.1px;border-radius:16px;
  background:linear-gradient(180deg,#ffe7a3,#f3bd52);
  color:#4a3214!important;border:2px solid #e2a744;
  box-shadow:inset 0 2px #fff2ce,0 4px #bf883c;
  font-weight:900;text-align:center;
}
#modal-primary-footer > .primary-button:focus-visible {
  outline:3px solid #2b6970;outline-offset:2px;
}
@media(max-height:570px){
 .modal.has-primary-footer,.immersive-game .modal.has-primary-footer{height:calc(100dvh - var(--safe-top,0px) - var(--safe-bottom,0px) - 22px)}
 #modal-primary-footer > .primary-button{min-height:50px;padding:11px}
}
