@import url("/static/ui/tokens.css");
@import url("/static/ui/components.css");

:root { --fl-page-max: 1600px; }

/* page base, same as the ui-kit examples: without it the body falls back to the browser serif on white */
html { min-height: 100%; background: var(--fl-color-bg0); color-scheme: dark; } /* the canvas follows html: always fills the viewport, also on short pages and overscroll */
body { min-height: 100vh; min-height: 100dvh; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--fl-font);
  font-size: var(--fl-fs-body);
  font-weight: var(--fl-fw-body);
  color: var(--fl-color-text0);
  background: var(--fl-color-bg0);
}

.fl-page {
  width: 100%;
  max-width: var(--fl-page-max);
  margin-inline: auto;
  padding-inline: var(--fl-space-lg);
  box-sizing: border-box;
}

.fl-grid {
  display: grid;
  gap: var(--fl-space-md);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

/* in-game MOTD and loading pages (Chromium panel, 1280x720 up to 2560x1440): kit sizes, 32px page padding as in the ui-kit examples, centred up to 1920px */
.motd { box-sizing: border-box; max-width: 1920px; margin-inline: auto; padding: var(--fl-space-lg); }
.fl-page.loading-page { max-width: 1920px; padding: var(--fl-space-xxl); min-height: 100vh; display: flex; flex-direction: column; box-sizing: border-box; }
.loading-page > .fl-grid { flex: 1 1 auto; align-content: center; }
.loading-page__foot { margin-top: var(--fl-space-lg); }
.loading-page .fl-bar > span { width: 0; }

.fl-table-wrap { overflow-x: auto; max-width: 100%; }

img { max-width: 100%; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--fl-space-md);
  padding-block: var(--fl-space-md);
}

.site-logout { margin: 0; }

/* tab rows wrap on narrow windows: a nowrap row made the page wider than the viewport (horizontal scrollbar strip at the bottom) */
.fl-tabs { flex-wrap: wrap; }

/* locked store tiles (prestige gate) are greyed; layout only */
.fl-tile.is-locked { opacity: 0.6; }

/* the hidden icon sprite must take no space (svg[hidden] was shown as an inline 150px box) */
svg[hidden] { display: none; }

/* Balance on the store (logged in) floats top-right while the page scrolls; kit surface, line and spacing tokens */
/* challenge rows: fixed columns so bars, counts, rewards and Done badges line up across rows */
.chal-row { display: grid; grid-template-columns: minmax(10rem, 2fr) minmax(8rem, 3fr) 6rem 8rem 5rem; align-items: center; gap: var(--fl-space-md); padding-block: var(--fl-space-xs); }
@media (max-width: 720px) { .chal-row { grid-template-columns: 1fr 1fr; } }
.store-notice { position: fixed; top: calc(var(--fl-space-lg) + 3rem); right: var(--fl-space-lg); z-index: 10; margin: 0; padding: var(--fl-space-xs) var(--fl-space-sm); border: var(--fl-line-w) solid var(--fl-color-line); border-radius: var(--fl-radius-md); background: var(--fl-color-bg1); }
.store-notice[hidden] { display: none; }
.store-balance { position: fixed; top: var(--fl-space-lg); right: var(--fl-space-lg); z-index: 10; padding: var(--fl-space-xs) var(--fl-space-sm); border: var(--fl-line-w) solid var(--fl-color-line); border-radius: var(--fl-radius-md); background: var(--fl-color-bg1); color: var(--fl-color-text0); }

/* Store tiles (ui-kit fl-tile): the whole tile is the click target (a reset button fills it); the price band sits at the bottom */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--fl-space-md); align-content: start; }
form.fl-tile { margin: 0; }
a.fl-tile { text-decoration: none; }
.store-tile__go { all: unset; box-sizing: border-box; display: flex; flex-direction: column; width: 100%; height: 100%; color: inherit; font: inherit; cursor: pointer; }
.store-tile__go:disabled { cursor: default; }
.store-tile__go:focus-visible { outline: var(--fl-line-w) solid var(--fl-color-accent); outline-offset: calc(-1 * var(--fl-line-w)); }
.store-tile__go > .fl-tile__price { margin-top: auto; }

/* Text and layout helpers (sizes and spacing only, via shared variables) */
.h-display { font-size: var(--fl-fs-display); font-weight: var(--fl-fw-display); margin: 0; }
.h-title { font-size: var(--fl-fs-title); font-weight: var(--fl-fw-title); margin: 0; }
.t-strong { font-weight: var(--fl-fw-strong); font-size: var(--fl-fs-strong); }
.t-small { font-size: var(--fl-fs-small); font-weight: var(--fl-fw-small); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fl-space-sm); }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--fl-space-sm); }
.section-gap { margin-block: var(--fl-space-lg); }
.num { font-variant-numeric: tabular-nums; }
.fl-progress { display: block; width: 100%; accent-color: var(--fl-color-accent); }
.fl-bullets { margin: 0; padding-inline-start: var(--fl-space-md); }

/* leaderboards: layout only (colours and sizes come from the shared ui-kit variables) */
.fl-lb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fl-space-sm); }
.fl-lb-podium { display: grid; gap: var(--fl-space-md); grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.fl-lb-cols { display: grid; gap: var(--fl-space-md); grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }

/* Store previews (flag canvas, icon sprite, swatch/title text): fixed 16:10 box so every tile lines up */
.store-preview { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 10; box-sizing: border-box; padding: var(--fl-space-xs); overflow: hidden; }
.store-preview__flag { display: block; width: 100%; height: 100%; }
.store-preview__icon { width: 40%; height: auto; max-height: 70%; fill: var(--fl-color-text2); }
.store-preview--text { font-weight: var(--fl-fw-display); font-size: var(--fl-fs-title); text-align: center; overflow-wrap: anywhere; }
