/* =====================================================================
   FISHING FRENZY 2 - the journey's page (index.html): the parts in their own frames, each filling the window. The
   fishing game's banner is the front page; the lesson dissolves in over it after Play, and out again after its last
   screen, over Popo's story.
   ===================================================================== */
*{box-sizing:border-box}
/* the fishing game's own blue (its .app), so the page and the game's first frames are one colour */
html,body{margin:0;height:100%;overflow:hidden;background:#063a8f;overscroll-behavior:none;touch-action:none;
  -webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}
body{background:radial-gradient(circle at 50% 30%,#0f55c4,#052a70 80%) fixed;
  font-family:'Fredoka','Arial Rounded MT Bold','Nunito',system-ui,-apple-system,'Segoe UI',sans-serif;color:#fff}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
[hidden]{display:none!important}

/* ---------- the parts: each a full-window frame. The fishing game shows at once (its own "Loading…" covers its
   wait); the lesson loads, unseen, behind it ---------- */
.part{position:fixed;left:0;top:0;width:100%;height:100%;border:0;display:block;background:transparent;
  visibility:hidden;pointer-events:none;z-index:1}
.part.live{visibility:visible;pointer-events:auto}
.part[data-part="lesson"]{z-index:2}
/* the fishing game while the lesson is over it: still there underneath, but nothing reaches it */
.part.covered{pointer-events:none}

/* ---------- one part to the other: the lesson's frame dissolves in over the game, and out again ---------- */
.part.arriving{animation:partIn .45s ease both}
.part.leaving{visibility:visible;pointer-events:none;z-index:3;animation:partOut .45s ease both}
@keyframes partIn{from{opacity:0}to{opacity:1}}
@keyframes partOut{from{opacity:1}to{opacity:0}}

/* ---------- only while the lesson is still loading after Play: a frosted veil with "Getting ready…" ---------- */
.veil{position:fixed;inset:0;z-index:40;visibility:hidden;opacity:0;pointer-events:none;overflow:hidden;
  background:radial-gradient(circle at 50% 42%,rgba(255,255,255,.92) 0%,rgba(234,247,255,.9) 40%,rgba(159,209,245,.88) 100%);
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);transition:opacity .35s ease,visibility 0s .35s}
.veil.on{visibility:visible;opacity:1;pointer-events:auto;transition:opacity .35s ease,visibility 0s}
.veil-status{position:absolute;left:50%;bottom:12%;translate:-50% 0;display:flex;align-items:center;gap:12px;padding:10px 20px;border-radius:999px;
  background:rgba(8,36,84,.72);border:2px solid rgba(255,248,236,.85);font:600 22px/1 'Fredoka','Arial Rounded MT Bold',system-ui,sans-serif;color:#fff8ec;white-space:nowrap;
  animation:statusIn .3s ease-out both}
@keyframes statusIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---------- the loading bar and Try again ---------- */
.bar{position:relative;width:120px;height:12px;border-radius:999px;background:rgba(255,255,255,.28);overflow:hidden}
.bar i{position:absolute;left:0;top:0;bottom:0;width:calc(var(--p,0) * 100%);min-width:12px;border-radius:999px;
  background:linear-gradient(90deg,#ffd166,#ff9f1c);transition:width .3s ease}
.bar.unknown i{width:36%;animation:barRun 1.1s ease-in-out infinite}
@keyframes barRun{from{left:-36%}to{left:100%}}
.retry{font:700 18px/1 'Fredoka','Arial Rounded MT Bold',system-ui,sans-serif;color:#4a2300;background:linear-gradient(180deg,#ffd27a,#f39a2e);border:2px solid #fff;
  border-radius:999px;padding:8px 16px;cursor:pointer;box-shadow:0 3px 0 #c76a10}
.retry:active{transform:translateY(2px);box-shadow:0 1px 0 #c76a10}
.retry:focus-visible{outline:3px solid #fff;outline-offset:3px}

/* ---------- a phone or tablet held upright: the fishing game's own pill, over every part ---------- */
.rotate-hint{display:none;position:fixed;left:50%;bottom:4vh;transform:translateX(-50%);z-index:60;padding:.6em 1.2em;border-radius:999px;
  background:rgba(8,36,84,.85);color:#ffe8bd;font:500 14px/1.3 'Fredoka','Arial Rounded MT Bold',system-ui,sans-serif;
  pointer-events:none;white-space:nowrap}
@media (max-aspect-ratio:20/23){.rotate-hint{display:block}}

.noscript{position:fixed;inset:auto 0 24px;margin:0;text-align:center;font:700 20px system-ui,sans-serif;color:#fff}

@media (prefers-reduced-motion:reduce){
  .part.arriving{animation:partIn .2s ease both}
  .part.leaving{animation:partOut .35s ease both}
  .bar.unknown i{animation:none;left:32%}
}
