/* This site's own CSS: only what the brand kit has no component for.
   Everything else is the kit (public/brand/template/*.css), loaded first.
   Radii, spacing, type sizes, colours, durations and shadows are tokens; if a
   number is written out below, it is not one the standard supplies. */

[hidden] { display: none !important; }

/* --- The sky -------------------------------------------------------------
   Artwork, not interface: a pixel Milky Way on a deep blue-black ground. The
   ground and the veil's vignette are drawn colours of that artwork, so they
   are written out here rather than taken from the page tokens (the owner
   asked for this background to stay exactly as it is; recorded in DESIGN.md).
   Everything that is interface sits on top of it and uses the tokens. */
:root { --sky-ground: #05060a; --sky-veil: 5, 6, 10; }
body { background: var(--sky-ground); overflow-x: hidden; }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated;
       image-rendering: crisp-edges; z-index: 0; }
.veil { position: fixed; inset: 0; z-index: 1; pointer-events: none;
        background:
          radial-gradient(120% 90% at 50% 45%, transparent 35%, rgba(var(--sky-veil), .55) 75%, rgba(var(--sky-veil), .92) 100%),
          linear-gradient(180deg, rgba(var(--sky-veil), .35), transparent 30%, transparent 70%, rgba(var(--sky-veil), .6)); }

/* --- The shell ----------------------------------------------------------- */
/* Order, back to front: sky (0), veil (1), game canvas (2), page (3). The page
   ignores the pointer except for its controls, so a click on empty sky reaches
   the game underneath. */
.page { position: relative; z-index: 3; min-height: 100%; display: flex; flex-direction: column; pointer-events: none; }
.bk-header a, .bk-header button, .bk-footer a, .start, #login { pointer-events: auto; }
#play { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; cursor: crosshair;
        touch-action: none; user-select: none; -webkit-user-select: none; }
html, body { height: 100%; }
/* The kit's top bar and foot are solid surfaces; here the sky runs edge to
   edge, so both are left transparent. Their size and spacing are the kit's. */
.bk-header, .bk-footer { background: transparent; }
.bk-header { position: relative; }
.bk-header .bk-actions { margin-inline-start: auto; }
.bk-footer { justify-content: space-between; }
.bk-footer .bk-small { color: var(--mute); gap: var(--s-3); align-items: center; }
/* a narrow phone: the brand lockup and the Login button have to share 375 px */
@media (max-width: 420px) {
  .bk-header .bk-brand img { height: 24px; }
  .bk-header .bk-mark { width: 28px; height: 28px; }
  #login-btn { padding-inline: var(--s-4); }
}
.bk-footer a:hover canvas { filter: brightness(1.3); }

main { flex: 1; }

/* --- Start ---------------------------------------------------------------
   Under the ship, which is the centre of the screen; game.js sets `top`. */
.start { position: fixed; left: 50%; translate: -50% 0; display: grid; justify-items: center;
         gap: var(--s-3); width: min(440px, calc(100vw - var(--s-5))); text-align: center; }
.start .coarse { display: none; }
@media (pointer: coarse) { .start .fine { display: none; } .start .coarse { display: inline; } }

/* --- Sign-in card ---------------------------------------------------------
   The kit's card and form controls (Material: outlined 56 px fields, pill
   buttons, a filled alert for the verdict), raised as a floating surface and
   docked under the Login button; on a phone it is a bottom sheet. Either way
   the middle of the screen stays clear for the game's PAUSED. */
#login { position: fixed; inset: calc(var(--header-h) + var(--s-2)) var(--s-4) auto auto; z-index: 20;
         width: min(400px, calc(100vw - var(--s-5))); max-height: calc(100dvh - var(--header-h) - var(--s-5));
         overflow: auto; border-radius: var(--r-xl); box-shadow: var(--shadow-3);
         /* not the kit's brown --card: the page colour, mostly see-through and blurred, so the card
            reads as dark glass over the sky; the bronze stays on the button and links */
         background: color-mix(in srgb, var(--page) 78%, transparent); border-color: var(--line);
         -webkit-backdrop-filter: blur(14px) saturate(120%); backdrop-filter: blur(14px) saturate(120%); }
/* A phone: the card hangs just under the game's PAUSED lettering (about 172 px down), and it is
   part of the page rather than fixed to the screen: while it is open the page gets extra room
   underneath, so when the keyboard comes up the whole page scrolls (the browser scrolls the field into view)
   instead of the card being squeezed or hidden. */
@media (max-width: 600px) {
  #login { position: absolute; width: auto; max-height: none; overflow: visible;
           inset: calc(var(--header-h) + var(--s-3) + var(--s-8) + var(--s-5) + var(--s-2)) var(--s-3) auto var(--s-3); }
  html.card-open .page { min-height: calc(100% + 45vh); }
}
#login .card-b { padding: var(--s-5); }
#login h2 { margin: 0; display: flex; }
.pw { position: relative; }
.pw .input { padding-inline-end: calc(var(--target) + var(--s-5)); }
.pw .reveal { position: absolute; top: 50%; right: var(--s-1); translate: 0 -50%; min-height: var(--target); }
#login .row { justify-content: space-between; }
#login .alert .small { display: block; }

/* The sign-in check: a few status lines, then the verdict. */
.trace { margin-bottom: 0; padding: 0; list-style: none; font: 400 var(--fs-xs)/1.75 var(--mono); color: var(--mute); }
.trace li { display: flex; gap: var(--s-3); align-items: baseline; }
.trace .st { width: var(--s-4); flex: 0 0 var(--s-4); text-align: center; }
.trace .ok { color: var(--ok); }
.trace .bad { color: var(--bad); }
.trace .run .st::after { content: "\2026"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.alert .ref { display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-2);
              font: 400 var(--fs-xs) var(--mono); color: var(--mute); }

#login.refused { animation: refuse var(--t-med) var(--ease); box-shadow: 0 0 0 2px var(--bad), var(--shadow-3); }
#login.refused.settle { box-shadow: var(--shadow-3); transition: box-shadow var(--t-med); }
@keyframes refuse { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); }
                    30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
