/* Styles shared by every page of the site: colors, fonts, cards, buttons and forms.
   The look matches the Constellations prototype (prototypes/constellations.html),
   so the site and its first game feel like one place.

   Colors and fonts are defined once below, as CSS variables. To change a color
   everywhere, change it here. */

:root {
  /* The site is always a night sky, so it uses the same dark colors everywhere. */
  color-scheme: dark;

  --color-paper: #080D20;      /* page background */
  --color-surface: #10183A;    /* cards */
  --color-ink: #E9EDFB;        /* main text */
  --color-muted: #A3AED3;      /* quieter text */
  --color-line: #2A3666;       /* borders */
  --color-accent: #FFE27A;     /* gold: buttons, highlights */
  --color-on-accent: #141A3A;  /* text on gold */
  --color-good: #7EE2A8;
  --color-bad: #FF8A80;

  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
}

/* ---------- Page basics ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--color-ink);
  font: 400 17px/1.55 var(--font-body);
  background: radial-gradient(ellipse at 20% -10%, #1B2558 0%, #0B1130 45%, var(--color-paper) 100%) fixed;
  background-color: var(--color-paper);
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; font-weight: 600; }
a { color: var(--color-accent); }

.muted { color: var(--color-muted); }

/* A narrow column in the middle of the screen, for forms and short pages. */
.narrow-page { max-width: 460px; margin: 0 auto; padding: 48px 20px 64px; }

/* The "Evening Rematch" name, with "Rematch" in gold. */
.site-name { font-weight: 800; color: var(--color-ink); text-decoration: none; }
.site-name span { color: var(--color-accent); }

/* ---------- Cards and buttons ---------- */

.card {
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  border: 1px solid var(--color-line);
  border-radius: 18px;
  padding: 22px;
}

.btn {
  font: inherit;
  font-weight: 700;
  border: 1.5px solid var(--color-accent);
  background: transparent;
  color: var(--color-accent);
  padding: .5em 1.15em;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn.primary { background: var(--color-accent); color: var(--color-on-accent); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.full-width { width: 100%; }

/* A clear outline for keyboard users, so they can always see where they are. */
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* ---------- Forms ---------- */

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }

.field input,
.field select {
  width: 100%;
  font: inherit;
  color: var(--color-ink);
  background: var(--color-paper);
  border: 1.5px solid var(--color-line);
  border-radius: 10px;
  padding: .55em .75em;
}
.field input:focus-visible,
.field select:focus-visible { outline-offset: 0; border-color: var(--color-accent); }

/* A field with a problem gets a red border; its message appears just below. */
.field [aria-invalid="true"] { border-color: var(--color-bad); }

.field-hint { font-size: .9rem; color: var(--color-muted); margin: 6px 0 0; }
.field-error { font-size: .92rem; font-weight: 700; color: var(--color-bad); margin: 6px 0 0; }
.field-error:empty { display: none; }

.form-error { font-weight: 700; color: var(--color-bad); text-align: center; margin: 12px 0 0; }
.form-error:empty { display: none; }

/* "New here? Sign up" and similar notes below a form. */
.form-footer { text-align: center; margin: 18px 0 0; font-size: .95rem; }

/* ---------- Live connection status ---------- */
/* A small dot and word showing whether this screen is connected to the server
   (see js/live-connection.js). Green when connected, amber while reconnecting. */
.live-status { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--color-muted); }
.live-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-muted);
}
.live-status[data-status="connected"]::before { background: var(--color-good); box-shadow: 0 0 8px var(--color-good); }
.live-status[data-status="reconnecting"]::before { background: var(--color-accent); }
