/* Shared shell for the Arcade site: same palette as the desktop app —
   near-black surfaces, Spotify-green accent. */

:root {
  --base: #121212;
  --field: #0d0d0d;
  --content: #ffffff;
  --muted: #b3b3b3;
  --subtle: #7c7c7c;
  --accent: #1ed760;
  --accent-hover: #1fdf64;
  --danger: #f87171;
  --line: rgba(255, 255, 255, 0.08);
  --bar: 56px;
}

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

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--base);
  color: var(--content);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Inter,
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Top bar ---------- */

header {
  flex: 0 0 auto;
  height: var(--bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(16px, 4vw, 32px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #000;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost,
.pill {
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.ghost {
  padding: 8px 14px;
  color: var(--muted);
}

.ghost:hover {
  color: var(--content);
  background: rgba(255, 255, 255, 0.08);
}

.pill {
  padding: 8px 16px;
  background: var(--content);
  color: #000;
}

.pill:hover {
  transform: scale(1.03);
}

/* ---------- Footer ---------- */

footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 14px clamp(16px, 4vw, 32px);
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--subtle);
}

footer nav {
  gap: clamp(12px, 3vw, 22px);
}

footer a {
  color: var(--subtle);
  transition: color 0.12s ease;
}

footer a:hover {
  color: var(--content);
}

/* ---------- Landing page ---------- */

/* Only the landing page forbids scrolling; a clipped form would be worse than
   a scrollbar, so the auth pages opt out of this. */
body.landing {
  overflow: hidden;
}

.landing-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4vh, 40px);
  padding: clamp(16px, 4vh, 48px) clamp(16px, 5vw, 32px);
  text-align: center;
}

.landing-main h1 {
  max-width: 17ch;
  font-size: clamp(1.75rem, 5.2vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

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

.download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px clamp(24px, 5vw, 40px);
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-size: clamp(0.95rem, 2vw, 1.0625rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 28px rgba(30, 215, 96, 0.22);
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

.download:hover {
  background: var(--accent-hover);
  transform: scale(1.03);
}

.download svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.meta {
  margin-top: -14px;
  font-size: 12.5px;
  color: var(--subtle);
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 5vw, 56px);
  padding-top: clamp(4px, 2vh, 16px);
  border-top: 1px solid var(--line);
}

.platform {
  min-width: 116px;
  text-align: left;
}

.platform h2 {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--subtle);
}

.platform ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.platform a {
  display: block;
  padding: 3px 0;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.12s ease;
}

.platform a:hover {
  color: var(--content);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Under ~380px tall the centre would clip; drop the optional bits first. */
@media (max-height: 380px) {
  .platforms,
  .meta {
    display: none;
  }

  body.landing footer {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

/* ---------- Auth pages ---------- */

/* Unlike the landing page, these scroll if they must: clipping a form would
   put the submit button out of reach on a short window. */
.auth-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: clamp(24px, 6vh, 56px) clamp(16px, 5vw, 32px);
}

.auth {
  width: 100%;
  max-width: 360px;
}

.auth h1 {
  margin-bottom: 6px;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth .lede {
  margin-bottom: 24px;
  font-size: 13.5px;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--content);
  font: inherit;
  font-size: 14px;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.field input::placeholder {
  color: var(--subtle);
}

.field input:focus {
  border-color: var(--accent);
  background: #141414;
  outline: none;
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.hint {
  font-size: 11.5px;
  color: var(--subtle);
}

/* Kept in the layout only when it has something to say, so the form does not
   shift as messages appear and disappear. */
.error:empty {
  display: none;
}

.error {
  margin-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--danger);
}

.submit {
  width: 100%;
  margin-top: 4px;
  padding: 13px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease,
    opacity 0.15s ease;
}

.submit:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.submit:disabled {
  opacity: 0.55;
  cursor: default;
}

.switch {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.switch a {
  color: var(--accent);
  font-weight: 700;
}

.switch a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Pages légales — du texte long, à l'inverse du reste du site.
   `.auth-main` les centre déjà et gère le défilement ; seule la colonne change
   de largeur, 360px étant illisible pour des paragraphes. */
.legal {
  width: 100%;
  max-width: 620px;
  align-self: flex-start;
}

.legal h1 {
  margin-bottom: 6px;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.legal h2 {
  margin: 28px 0 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
}

.legal p,
.legal li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.legal p + p {
  margin-top: 10px;
}

.legal .lede {
  margin-bottom: 4px;
  font-size: 15px;
}

.legal ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.legal li + li {
  margin-top: 4px;
}

.legal a {
  color: var(--accent);
  font-weight: 600;
}

.legal a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  word-break: break-all;
}

.legal strong {
  color: var(--content);
}

.legal-date {
  margin-top: 32px;
  font-size: 12.5px;
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
