/* Page shell shared by every page: the block world behind everything, the effect canvases,
   the page column and the hotbar that links the tools together. Load after tokens.css. */

.world {
  position: fixed; inset: -64px 0; z-index: -2; pointer-events: none;
  background-color: var(--world);
  background-image:
    linear-gradient(90deg, var(--block-edge) 0 3px, transparent 3px),
    linear-gradient(var(--block-edge) 0 3px, transparent 3px),
    linear-gradient(135deg, var(--block-hi) 0 30%, var(--block) 30% 100%);
  background-size: 64px 64px;
  will-change: transform;
}
.world::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 124, 207, .16), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 10%, rgba(47, 142, 196, .22), transparent 75%),
    linear-gradient(rgba(10, 20, 36, .5), rgba(10, 20, 36, .9) 75%);
}
.fx-ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; width: 100%; height: 100%; }
.fx-burst { position: fixed; inset: 0; z-index: 40; pointer-events: none; width: 100%; height: 100%; }

/* page column; every page puts its content in <main class="page"> */
.page {
  max-width: 1040px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 58px calc(140px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 46px;
}
.page-foot { display: grid; justify-items: center; gap: 4px; text-align: center; color: var(--sky-text); font-size: 13px; }
.page-foot a { color: var(--white); font-weight: 700; }

/* ---------- hotbar: one slot per page, built by site.js from tools.js ---------- */
.hotbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: linear-gradient(#173a5c, var(--navy-dk)); border-top: 3px solid #3c8cc4; box-shadow: 0 -4px 0 rgba(0, 0, 0, .35);
  animation: hotbar-up .6s var(--ease-spring) .5s backwards;
}
.hotbar ul { list-style: none; margin: 0 auto; padding: 0; max-width: 560px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.hot {
  position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 2px 5px; min-width: 0;
  border-radius: 10px; background: linear-gradient(#24496c, #163452); border: 2px solid #4f9fd3;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 3px 0 rgba(0, 0, 0, .35);
  color: var(--sky-text); font-size: 11px; font-weight: 700; letter-spacing: .02em; text-decoration: none;
  transition: transform .3s var(--ease-spring), filter .2s;
}
a.hot:hover { transform: translateY(-3px); filter: brightness(1.12); }
.hot svg { width: 28px; height: 28px; }
.hot .art { display: grid; place-items: center; }
.hot .ic { transform-box: fill-box; transform-origin: 50% 50%; }
a.hot:hover .ic { animation: hot-boing .5s var(--ease-spring); }
.hot .lbl { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot[aria-current="page"] {
  transform: translateY(-7px); border-color: var(--gold); color: var(--white);
  background: linear-gradient(#2f6a99, #1d4b74);
  box-shadow: 0 0 0 2px var(--gold-dk), inset 0 2px 0 rgba(255, 255, 255, .2), 0 6px 0 rgba(0, 0, 0, .35), 0 0 22px rgba(246, 199, 0, .35);
}
.hot.soon { opacity: .55; cursor: default; }
.hot .badge { position: absolute; top: -7px; right: -6px; width: 19px; height: 19px; padding: 2px; display: grid; border-radius: 50%; background: var(--cream); border: 2px solid #4f9fd3; }
.hot .badge svg { width: 100%; height: 100%; }
.hot.soon .badge { border-color: #5b6b7a; }
@media (max-width: 420px) { .hotbar ul { gap: 5px; } .hot { font-size: 10px; } .hot svg { width: 24px; height: 24px; } }

.hotbar.steady { animation: none; }

/* clan chat button: a small square in the bar's right corner, on every page */
.hot.chat {
  position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); top: 50%; translate: 0 -50%;
  width: 42px; height: 42px; padding: 0; place-items: center; place-content: center;
  border-color: var(--pink); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), 0 3px 0 rgba(0, 0, 0, .35), 0 0 12px rgba(255, 124, 207, .25);
}
.hot.chat svg { width: 30px; height: 30px; }
/* on narrow screens the tool slots make room for it */
@media (max-width: 720px) { .hotbar ul { margin-right: 50px; } }
@media (max-width: 420px) { .hot.chat { width: 38px; height: 38px; } .hot.chat svg { width: 26px; height: 26px; } .hotbar ul { margin-right: 44px; } }

/* page changes: the content fades out quickly when you follow a link within the site (site.js adds
   .leaving), and the new page's content fades up into place. The background and the bar stay put. */
body > main { animation: page-in .24s var(--ease-out) backwards; }
body.leaving > main { opacity: 0; translate: 0 -4px; transition: opacity .12s ease-in, translate .12s ease-in; }
@keyframes page-in { from { opacity: 0; translate: 0 6px; } }
@keyframes hotbar-up { from { translate: 0 110%; } }
@keyframes hot-boing { 0% { transform: scale(1); } 30% { transform: scale(1.3, .82); } 60% { transform: scale(.92, 1.12); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .hotbar, a.hot:hover .ic, body > main { animation: none; }
  body.leaving > main { transition: none; }
  .hot { transition: none; }
}
