/* The website's pages (PLAY-FLOW-PLAN 4.5, C25): one header, one stylesheet, the landing page's look (pixel headings
   drawn by landing.js, a monospace body, hull-block buttons). Every page that is not the game links this file. */
:root { --bg: #0a0e16; --panel: #111823; --line: #2a323f; --dim: #59626e; --mid: #7d8794; --hi: #a3adba; --you: #4285f4; --you-lit: #5b9bff; --you-edge: #2e5dab; --shot: #9cdfff; --gold: #ffd27a;
  --cannon: #ff4d7a; --reactor: #5cf08c; --gut: 40px; }
@media (max-width: 699px) { :root { --gut: 16px; } }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; color: var(--hi); font: 17px/1.65 Consolas, Menlo, "DejaVu Sans Mono", ui-monospace, monospace; overflow-x: hidden; }
canvas { image-rendering: crisp-edges; image-rendering: pixelated; }
a { color: #fff; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
p { margin: 0 0 14px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pxc { display: block; }
html:not(.js) [data-px] { font-weight: bold; color: #fff; letter-spacing: 1px; text-transform: uppercase; }
#sky { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; z-index: -1; display: block; }

/* ---- The header: the same on every page. Signed out: SIGN IN; signed in: your ship, your name, SIGN OUT. PLAY last. ---- */
.site-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 22px; padding: 14px var(--gut); background: rgba(10, 14, 22, 0.92); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.site-bar .brand { text-decoration: none; }
.site-bar .brand .pxc { display: inline-block; vertical-align: middle; }
.site-bar nav { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-right: auto; font-size: 14px; letter-spacing: 1px; }
.site-bar nav a, .site-bar .who a, .site-bar .who button { color: var(--mid); text-decoration: none; }
.site-bar nav a:hover, .site-bar .who a:hover, .site-bar .who button:hover, .site-bar nav a[aria-current="page"] { color: #fff; }
.site-bar .who { display: flex; align-items: center; gap: 10px; font-size: 14px; letter-spacing: 1px; }
.site-bar .who canvas { width: 30px; height: 30px; }
.site-bar .who .name { color: #fff; }
.site-bar .who button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: 1px; }
.site-bar .play { padding: 9px 16px 12px; box-shadow: inset -4px -4px 0 var(--you-edge); }
@media (max-width: 699px) { .site-bar .who canvas { display: none; } .site-bar .play { padding: 6px 10px 9px; } .site-bar .who { gap: 8px; font-size: 13px; }
  .site-bar { gap: 10px 12px; padding-top: 10px; padding-bottom: 10px; } .site-bar nav { order: 3; width: 100%; gap: 6px 14px; margin-right: 0; font-size: 13px; } .site-bar .who { margin-left: auto; } .site-bar .wide { display: none; } }

/* ---- Buttons: a hull block, flat fill and a darker right and bottom edge. ---- */
.play, .btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #fff; text-decoration: none; font: inherit; letter-spacing: 1px; border: 0; cursor: pointer; }
.play { background: var(--you); padding: 18px 34px 22px 30px; box-shadow: inset -6px -6px 0 var(--you-edge); }
.play .pxc { display: block; }
.play:active, .btn:active { transform: translate(2px, 2px); }
.btn { background: #3a424e; padding: 9px 16px 12px; box-shadow: inset -4px -4px 0 #262c35; font-size: 15px; min-height: 44px; box-sizing: border-box; }
.btn:hover { background: #4a5361; }
.btn.go { background: var(--you); box-shadow: inset -4px -4px 0 var(--you-edge); }
.btn.go:hover { background: var(--you-lit); }
.btn.quiet { background: var(--panel); box-shadow: inset -3px -3px 0 #0b1018, 0 0 0 1px var(--line); color: var(--hi); }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn.small { min-height: 36px; padding: 6px 12px 8px; font-size: 13px; }

/* ---- A page ---- */
.page { max-width: 1040px; margin: 0 auto; padding: 56px var(--gut) 40px; box-sizing: border-box; }
.page h1 { color: #fff; margin: 0 0 16px; }
.page h2 { color: #fff; margin: 48px 0 18px; }
.intro { color: var(--mid); max-width: 640px; }
.kicker { color: var(--dim); font-size: 14px; letter-spacing: 3px; margin-bottom: 12px; }
.panel { background: var(--panel); box-shadow: 0 0 0 1px var(--line); padding: 18px 20px; box-sizing: border-box; }
.note { color: var(--dim); font-size: 14px; }
.gold { color: var(--gold); }
.row-gap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.status { min-height: 1.65em; color: var(--mid); }
.status.bad { color: var(--cannon); }
footer { border-top: 1px solid var(--line); padding: 26px var(--gut) 40px; color: var(--dim); font-size: 14px; line-height: 1.9; max-width: 1240px; margin: 40px auto 0; box-sizing: border-box; }
footer a { color: var(--mid); }

/* ---- Leaderboards ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.tabs button { font: inherit; font-size: 13px; letter-spacing: 1px; color: var(--hi); background: var(--panel); border: 0; box-shadow: inset -3px -3px 0 #0b1018, 0 0 0 1px var(--line); padding: 8px 12px 10px; cursor: pointer; min-height: 40px; }
.tabs button[aria-selected="true"] { color: #fff; background: #16233b; box-shadow: inset -3px -3px 0 var(--you-edge), 0 0 0 1px var(--you); }
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 4px; border-bottom: 1px solid #18202c; }
.board li .rank { color: var(--dim); text-align: right; }
.board li button { font: inherit; color: #fff; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 32px; }
.board li button:hover { text-decoration: underline; }
.board li .val { color: var(--hi); white-space: nowrap; }
.board li.you { background: #16233b; }
.board li.you button::after { content: " (YOU)"; color: var(--you-lit); }
.board li button .ttl { display: block; color: var(--dim); font-size: 0.8em; line-height: 1.2; }
.card .ttl { color: var(--gold, #d8a838); margin: -6px 0 12px; }
.badge { color: var(--gold); font-size: 12px; margin-left: 6px; }
.card dl { display: grid; grid-template-columns: auto auto; gap: 4px 18px; margin: 0; }
.card dt { color: var(--dim); }
.card dd { margin: 0; color: #fff; text-align: right; }
.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 799px) { .two { grid-template-columns: minmax(0, 1fr); } }

/* ---- Hangar (HANGAR-PLAN 2.5): your ship, then three rows of four tiles, then the titles and badges ladder ---- */
.hangar { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.hangar .pilot { text-align: center; }
.hangar canvas.ship { width: 240px; height: 180px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); display: block; image-rendering: pixelated; }
.hangar .me { color: #fff; margin: 12px 0 2px; }
.hangar .title { color: var(--gold); margin: 0; font-size: 13px; letter-spacing: 1px; }
.looks-row { margin-bottom: 18px; }
.looks-label { font-size: 13px; font-weight: normal; letter-spacing: 1px; color: var(--dim); margin: 0 0 8px; }
.looks-label .worn { color: #fff; margin-left: 6px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 4px 8px; min-height: 44px; background: var(--panel); border: 1px solid var(--line); color: var(--hi, #c4cbd4); font: inherit; font-size: 12px; cursor: pointer; }
.tile canvas { width: 100%; max-width: 128px; height: auto; aspect-ratio: 8 / 5; image-rendering: pixelated; display: block; }
.tile[aria-pressed="true"] { border-color: #fff; color: #fff; box-shadow: 0 0 0 1px #fff; }
.tile.locked { color: var(--dim); }
.tile.tapped { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.tile:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.status.gold { color: var(--gold); min-height: 1.2em; }
.ladder-head { margin-top: 40px; }
.ladder h3 { font-size: 13px; letter-spacing: 1px; color: var(--dim); font-weight: normal; }
.ladder .how { color: var(--mid); font-size: 13px; flex: 1; }
.ladder .have .who { color: var(--gold); }
@media (max-width: 699px) { .hangar { grid-template-columns: minmax(0, 1fr); } .hangar canvas.ship { width: 100%; max-width: 240px; height: auto; aspect-ratio: 4 / 3; margin: 0 auto; } }

/* ---- Friends ---- */
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 4px; border-bottom: 1px solid #18202c; }
.people .who { color: #fff; min-width: 9em; }
.people .where { color: var(--mid); margin-right: auto; font-size: 14px; }
.people .where.on { color: var(--reactor); }

/* ---- Supporters ---- */
.names { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.names li { color: #fff; }
.tips { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- Sign in ---- */
.signin { max-width: 460px; }
.signin .btn { width: 100%; justify-content: center; margin-bottom: 12px; }
.signin input { font: inherit; color: #fff; background: var(--panel); border: 0; box-shadow: 0 0 0 1px var(--line); padding: 10px 12px; width: 100%; box-sizing: border-box; text-transform: uppercase; min-height: 44px; }
.signin label { display: block; color: var(--mid); margin-bottom: 6px; }

/* ---- Your home (signed in, at /) ---- */
.home { max-width: 1240px; margin: 0 auto; padding: 40px var(--gut) 24px; box-sizing: border-box; }
.home-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.home-grid .panel h3 { margin: 0 0 10px; color: #fff; font-size: 15px; letter-spacing: 1px; }
.home .ship canvas { width: 100%; height: auto; aspect-ratio: 4 / 3; display: block; }
.home dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; font-size: 15px; }
.home dd { margin: 0; color: #fff; text-align: right; }
.home .welcome { color: #fff; margin: 0 0 24px; letter-spacing: 1px; }
.home .home-title { color: var(--gold); margin: -18px 0 24px; letter-spacing: 2px; }
@media (max-width: 999px) { .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 699px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
