.resultCard{max-height:calc(100dvh - 28px);overflow:auto;}
#resultOverlay .resultSub{background:none;color:#fff;text-align:center;}
#resultOverlay .resultButtons{
  display:flex !important;flex-direction:row !important;
  align-items:center;justify-content:space-between;gap:16px;
  width:min(340px,100%);margin:18px auto 0;
}
#resultOverlay .resultMenuReturn{
  display:flex;align-items:center;justify-content:center;
  width:88px;min-width:88px;min-height:44px;padding:0;
  border:0;background:transparent;box-shadow:none;
}
#resultOverlay .resultMenuReturn img{display:block;width:88px;height:40px;object-fit:contain;}
#resultOverlay .resultRestart{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  width:auto;min-width:0;min-height:44px;padding:5px 10px;
  background:rgba(16,36,78,.75);color:#fff;
  border:1px solid rgba(255,255,255,.7);border-radius:10px;
  font-size:13px;line-height:1.2;white-space:nowrap;
  box-shadow:none !important;text-shadow:none !important;
}
#resultOverlay .resultRestart .diceRestartIcon{
  width:20px;height:20px;flex:none;fill:none;stroke:currentColor;
  stroke-width:2;stroke-linecap:round;stroke-linejoin:round;
}
.resultRecordNotice{margin:14px 0;color:#a9eaff;font-weight:700;line-height:1.6;}
.resultRecordNotice[hidden],.resultPostcards[hidden]{display:none;}
.resultPostcards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0;}
.resultPostcards figure{margin:0;min-width:0;}
.resultPostcards img{
  display:block;width:100%;height:clamp(80px,18vw,160px);object-fit:contain;
  background:transparent;border:0;border-radius:0;box-sizing:border-box;
}
.resultPostcards figcaption{margin-top:6px;font-size:13px;line-height:1.5;overflow-wrap:anywhere;}
/* Use the extra width to keep the complete journey visible on landscape phones. */
@media (orientation:landscape) and (max-height:500px){
  html body #resultOverlay .resultCard{
    box-sizing:border-box;width:min(900px,calc(100vw - 20px));
    max-height:calc(100dvh - 12px);padding:8px 14px;border-width:3px;border-radius:18px;
    display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 12px;align-items:center;
  }
  #resultOverlay .resultMain{grid-column:1;grid-row:1;font-size:28px;text-align:left;}
  #resultOverlay .resultLanguage{grid-column:2;grid-row:1;margin:0;}
  #resultOverlay .resultSub{
    grid-column:1 / -1;margin:0;padding:0;font-size:16px;line-height:1.3;
  }
  #resultOverlay .resultRecordNotice{grid-column:1 / -1;margin:0;font-size:12px;line-height:1.3;}
  #resultOverlay .resultPostcards{grid-column:1 / -1;gap:12px;margin:0;}
  #resultOverlay .resultPostcards img{height:clamp(48px,20dvh,88px);border-width:0;}
  #resultOverlay .resultPostcards figcaption{margin-top:3px;font-size:11px;line-height:1.2;}
  html body #resultOverlay .resultCard .resultButtons{width:min(288px,100%);margin:0;gap:8px;}
  #resultOverlay .resultRewards{margin:0;gap:4px;}
}
.goal-flight-stage{position:fixed;inset:0;z-index:10000;overflow:hidden;pointer-events:none;}
.goal-flight-trail{position:absolute;inset:0;width:100%;height:100%;}
.goal-flight-trail line{
  stroke:#8aeaff;stroke-width:3;stroke-linecap:round;
  filter:drop-shadow(0 0 5px #21adff) drop-shadow(0 0 12px #168aff);
  animation:goal-flight-draw 2s cubic-bezier(.4,0,.2,1) both,goal-flight-fade .8s 1.8s ease-out forwards;
}
.goal-flight-plane{
  position:absolute;left:0;top:0;width:76px;height:76px;color:#fffaf0;
  filter:drop-shadow(0 0 6px #8aeaff) drop-shadow(0 0 18px #168aff);
  animation:goal-flight-cross 2s cubic-bezier(.4,0,.2,1) both,goal-flight-fade .5s 2s ease-out forwards;
}
@keyframes goal-flight-cross{
  from{transform:translate(var(--flight-start-x),var(--flight-start-y)) translate(-50%,-50%) rotate(var(--flight-angle));}
  to{transform:translate(var(--flight-end-x),var(--flight-end-y)) translate(-50%,-50%) rotate(var(--flight-angle));}
}
@keyframes goal-flight-draw{from{stroke-dashoffset:var(--flight-distance);}to{stroke-dashoffset:0;}}
@keyframes goal-flight-fade{from{opacity:1;}to{opacity:0;}}
