@font-face{font-family:Timber;font-weight:400;src:url("/static/66770f1e69da7d0dffbee85ae047b905329c340b3aaabc19f0e830d8759dadbb/SourceSans3-Regular.ttf")}
@font-face{font-family:Timber;font-weight:600;src:url("/static/3816faf5f706905cb0e866db53085ad098c2bfae1f828e85a04e338c428ee380/SourceSans3-Semibold.ttf")}

/* Mirrors game/src/hud/theme.rs; a Rust unit test keeps these colors in sync,
   so the intro's panels match the Bevy menu it lifts to. */
:root{
  --surface:#f7f2e3;--card:#fffbf1;--text:#30332e;--muted:#666357;--line:#c2b59e;
  --accent:#4f6b4f;--selected:#d6e3c7;--problem:#9c4721;--water:#3a82b8;--deep:#306fa0;--shallows:#61b3c5;
  --shadow:0 3px 10px #29211426;--radius:6px;
  /* theme::backdrop: sunlit shallows behind the cards, deepening towards the edges. */
  --backdrop:radial-gradient(80% 60% at 50% 70%,var(--shallows),var(--water) 35%,var(--deep) 70%)
}
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden}
body{font:400 16px/1.4 Timber,system-ui,sans-serif;color:var(--text);background:var(--surface)}
#game{display:block;width:100%;height:100%;outline:none}
h1,h2{margin:0;font-size:20px;font-weight:600;line-height:1.25}
p{margin:0}
[hidden]{display:none!important}

/* The intro: five shots of the islands, one line each, played by CSS on the
   compositor while the WASM streams and compiles. web/intro.js decides when it ends. */
#splash{position:absolute;inset:0;z-index:4;overflow:hidden;background:var(--backdrop),var(--deep);transition:opacity .8s ease}
#splash.closing{opacity:0;pointer-events:none}
/* The story's clock: web/intro.js ends the story when this runs out. */
.shots{animation:intro-story 30s linear both}
@keyframes intro-story{to{visibility:visible}}
.shot{position:absolute;inset:0;opacity:0;animation:intro-in .9s ease var(--at) both,intro-out .9s ease calc(var(--at) + var(--d)) forwards}
.shot:last-child{animation:intro-in .9s ease var(--at) both}
.frame{position:absolute;inset:0;background:center/cover no-repeat;animation:intro-pan calc(var(--d) + 1.8s) linear var(--at) both}
/* CSS urls, so build_web.py rewrites them to the published assets. */
.islands{--at:0s;--d:6.2s}.islands .frame{background-image:url("/static/c33fd903b8781010cdcb5a04e0fbe8b3022444a5033cd292e14399e252f1c2bf/islands.webp");--to:translate(-1.5%,.5%)}
.bridge{--at:6.2s;--d:6.4s}.bridge .frame{background-image:url("/static/215744cc708104493fd2ada6beeb7c2520c115b64727675d7d36d0b90c1b9a96/bridge.webp");--to:translate(1.5%,-1%)}
.neighbour{--at:12.6s;--d:6.8s}.neighbour .frame{background-image:url("/static/805d438ea860b571cbcc72e1e3834dc999ce5b63fac2a6b5b328e0e39b204e67/neighbour.webp");--to:translate(-3%,-.5%);filter:brightness(.62) saturate(.75) hue-rotate(-8deg)}
.blackshard{--at:19.4s;--d:4.4s}.blackshard .frame{background-image:url("/static/cb285a5149061df646cd7205f4e2dfe5146d2e695890eda5060360564c50f309/blackshard.webp");--to:translate(-2.5%,1.5%);filter:brightness(.62) saturate(.75) hue-rotate(-8deg)}
.catapults{--at:23.8s;--d:6.2s}.catapults .frame{background-image:url("/static/3cde25d34608998cfff047ded7581b129d5ade39c06d2088e90bba9fd676ba66/catapults.webp");--to:translate(2%,1%)}
.caption{position:absolute;left:50%;bottom:9vh;width:max-content;max-width:min(860px,70vw);padding:16px 28px;transform:translateX(-50%);
  font-size:clamp(20px,1.75vw,28px);line-height:1.4;text-align:center;text-wrap:balance;background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);box-shadow:var(--shadow);opacity:0;animation:intro-in .8s ease calc(var(--at) + .5s) both,intro-out .5s ease calc(var(--at) + var(--d) - .3s) forwards}
.shot:last-child .caption{animation:intro-in .8s ease calc(var(--at) + .5s) both}
@keyframes intro-in{from{opacity:0}to{opacity:1}}
@keyframes intro-out{from{opacity:1}to{opacity:0}}
@keyframes intro-pan{from{transform:scale(1.03)}to{transform:scale(1.14) var(--to)}}
/* Once the story ends or is skipped: the title, and why it is still up. */
.end{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;gap:14px;padding:24px;text-align:center;
  background:#141c28b8;color:var(--card);opacity:0;visibility:hidden;transition:opacity .8s ease,visibility .8s}
.ended .end,.failed .end{opacity:1;visibility:visible}
.ended .caption,.failed .caption{opacity:0!important;transition:opacity .4s}
#splash .end h1{font-size:56px;letter-spacing:.02em}
.end .loading{color:#e9dfc9}
.failed .loading{display:none}
#splash-error{max-width:480px;padding:12px 18px;color:var(--problem);background:var(--card);border-radius:var(--radius)}
#splash-error:empty{display:none}
#skip{position:absolute;top:24px;right:24px;z-index:1;min-height:36px;padding:0 10px 0 14px;display:flex;align-items:center;gap:8px;
  font:inherit;color:var(--text);background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);cursor:pointer}
#skip:hover{background:var(--surface)}
#skip:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#skip kbd{font:inherit;font-size:13px;color:var(--muted);padding:0 5px;border:1px solid var(--line);border-radius:4px}
.ended #skip,.failed #skip{display:none}
@media(prefers-reduced-motion:reduce){.frame{animation:none}}

#resize{position:absolute;inset:0;z-index:10;display:none;place-items:center;background:var(--backdrop),var(--deep)}
#resize>div{width:440px;padding:24px;display:flex;flex-direction:column;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
#resize p{color:var(--muted)}
@media(max-width:1149px),(max-height:759px){#resize{display:grid}}
