/* The Game Night Guild title screen -- ONE implementation (GNG-006).
 *
 *     FOUR GAMES, ONE PRODUCT -- ONE SHARED PRESENTATION.
 *
 * Through GNG-005 this stylesheet existed four times, as a ~230-line <style>
 * block inside each game's host_login.html. That duplication was deliberate:
 * CLAUDE.md kept "common launcher / UI chrome" on the NOT YET list until four
 * working games had proven what was genuinely shared. They have, so this is
 * the extraction that waiting period was for.
 *
 * WHAT THIS FILE CONTAINS
 *     Layout, type scale, spacing, responsive and reduced-motion behaviour for
 *     the Guild lockup and the host-login card.
 *
 * WHAT THIS FILE DELIBERATELY CONTAINS NO OF
 *     Brand colour literals. Every colour is `var(--gng-*)`, declared by
 *     core/templates/shared/_guild_brand_vars.html straight out of
 *     `core.brand.css_variables()`. There is therefore exactly one definition
 *     of "Guild navy" reaching this page, and a colour cannot drift here
 *     without drifting in Python first. `tests/test_guild_brand.py` asserts
 *     this file declares no hex literal and no literal rgba() at all.
 *
 *     GNG-021: the values come from the DEPLOYMENT's effective brand
 *     (core.branding). Unset BRAND_* variables give the Guild exactly; a
 *     corporate deployment's three colours give a derived palette under the
 *     same names, plus --gng-on-* (text ON a fill) and --gng-gold-text (the
 *     accent AS text) so this page stays legible on any client's colours.
 *
 * WHAT THIS FILE IS NOT
 *     Authentication. The form this styles POSTs to each game's OWN login
 *     route, with that game's OWN CSRF token, and sets that game's OWN session
 *     key. GNG-006 shares the presentation and nothing else -- there is no
 *     core/auth.py, no shared host session, and no `host_required` in core.
 *
 * Served from the shell's own static folder at /static/guild-title.css, which
 * is same-origin for every game, so each game's existing
 * `style-src 'self'` CSP covers it unchanged.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 20px;
  font-family: var(--gng-title-font);
  color: var(--gng-text-primary);
  /* THE CANONICAL GUILD BACKGROUND. The same gradient string the launcher
     paints and the same one every game's `guild` theme sets, because it comes
     from the same constant. This is the convergence the card exists for: a
     host moving launcher -> game -> game sees one colour, not four
     approximations of one colour. */
  background: var(--gng-bg-gradient);
  background-color: var(--gng-navy);
  background-attachment: fixed;
}

/* --- the lockup ------------------------------------------------------ */

.title-screen {
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title-screen__logo {
  width: 150px;
  height: auto;
  display: block;
}

/* GNG-021: a corporate lockup has no known shape; fit it in the Guild
   lockup's box rather than forcing the Guild lockup's width. */
.title-screen__logo--brand {
  width: auto;
  max-width: 240px;
  max-height: 150px;
  object-fit: contain;
}

/* GNG-021: BRAND_EVENT_NAME, between "presents" and the game's ribbon. Not
   rendered at all when unset. */
.title-screen__event {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  color: var(--gng-gold-text);
  overflow-wrap: anywhere;
}

.title-screen__presents {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gng-text-muted);
}

/* The ribbon. clip-path notches both ends into a chevron; a browser without
   clip-path support simply gets a solid purple bar, which is still the right
   lockup. The game's name is the ONLY per-game content on this screen. */
.title-screen__game {
  margin: 16px 0 0;
  padding: 14px 48px;
  background: var(--gng-purple);
  color: var(--gng-on-purple);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 20px) 50%, 100% 100%, 0 100%, 20px 50%);
}

/* --- the login card -------------------------------------------------- */

.title-card {
  margin-top: 36px;
  width: 100%;
  padding: 28px;
  background: var(--gng-navy-deep);
  border: 2px solid var(--gng-border-blue);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.title-card__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  color: var(--gng-gold-text);
}

.title-card__subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  text-align: center;
  color: var(--gng-text-soft);
}

.title-card__error {
  margin: 0;
  padding: 12px;
  border: 2px solid var(--gng-danger);
  border-radius: 10px;
  background: rgba(var(--gng-danger-rgb), 0.12);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: var(--gng-text-primary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gng-gold-text);
}

input[type="password"] {
  width: 100%;
  padding: 15px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 17px;
  color: var(--gng-text-primary);
  background: var(--gng-navy-input);
  border: 2px solid var(--gng-border-blue);
  border-radius: 10px;
}

input[type="password"]:focus {
  outline: none;
  border-color: var(--gng-gold);
}

button[type="submit"] {
  width: 100%;
  padding: 16px;
  font-family: var(--gng-title-font);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--gng-on-cyan);
  background: var(--gng-cyan);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

button[type="submit"]:hover {
  background: var(--gng-gold);
  color: var(--gng-on-gold);
  transform: translateY(-2px);
}

/* Keyboard users must be able to see where they are. */
button[type="submit"]:focus-visible,
input[type="password"]:focus-visible,
.title-screen__siblings a:focus-visible {
  outline: 2px solid var(--gng-gold);
  outline-offset: 3px;
}

/* --- sibling navigation ---------------------------------------------- */

.title-screen__siblings {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.title-screen__siblings-label {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gng-text-muted);
}

.title-screen__siblings-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.title-screen__siblings a {
  color: var(--gng-cyan);
  text-decoration: none;
}

.title-screen__siblings a:hover {
  color: var(--gng-gold-text);
}

.title-screen__dot {
  width: 4px;
  height: 4px;
  border-radius: 99px;
  background: var(--gng-line-dashed);
}

/* --- responsive / reduced motion ------------------------------------- */

@media (max-width: 420px) {
  .title-screen__game {
    font-size: 28px;
    padding: 12px 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  button[type="submit"] {
    transition: none;
  }

  button[type="submit"]:hover {
    transform: none;
  }
}
