/* Shared by index.html and the legal pages: radius scale, HR divider, site footer.
   Reads the theme tokens (--foreground, --brand, --border ...) from styles.css / legal.css. */

:root {
  --r-sm: .5rem;
  --r-md: .75rem;
  --r-lg: 1rem;
  --hr-ink: color-mix(in srgb, var(--foreground) 16%, transparent);
}

/* ---------- HR divider ---------- */
.hr {
  position: relative;
  display: block;
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--hr-ink) 16%, var(--hr-ink) 84%, transparent);
}
/* Premium variant: a brand-coloured core with a soft bloom, fading out on both sides */
.hr--glow::before,
.hr--glow::after {
  content: "";
  position: absolute;
  inset-inline: 34%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
}
.hr--glow::before { top: 0; height: 1px; opacity: .85; }
.hr--glow::after  { top: -2px; height: 5px; border-radius: 999px; opacity: .35; filter: blur(4px); }
/* Quiet variant for inner dividers */
.hr--soft { --hr-ink: color-mix(in srgb, var(--foreground) 10%, transparent); }

/* ---------- Site footer ---------- */
.site-footer {
  width: 100%;
  margin-top: auto;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}
/* On the game page the footer only shows with the Home screen */
#app > .site-footer { display: none; padding-top: 1.5rem; }
/* Home footer: Game modes and Legal columns sit side by side, compact, at the right on wide screens */
#app > .site-footer .site-footer-inner { gap: 1.25rem; padding-block: 1.5rem 1.25rem; }
#app > .site-footer .sf-cols { grid-template-columns: repeat(2, max-content); justify-content: start; gap: 1.25rem 3.5rem; }
@media (min-width: 720px) {
  #app > .site-footer .site-footer-inner { grid-template-columns: minmax(0, 1fr) auto; }
  #app > .site-footer .sf-cols { justify-content: end; }
}
#app:has([data-screen="home"]:not([hidden])) > .site-footer { display: block; }
/* Home fills one full screen, so the footer sits below the fold and the page scrolls to it */
#app:has([data-screen="home"]:not([hidden])) { justify-content: flex-start; }
#app > [data-screen="home"]:not([hidden]) { flex: 0 0 auto; min-height: calc(100dvh - 1.25rem); }

.site-footer-inner {
  width: min(100%, 72rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-block: 2rem 1.75rem;
}
.sf-brand p {
  max-width: 30ch;
  margin: .85rem 0 0;
  color: var(--foreground-muted);
  font-size: .875rem;
  line-height: 1.6;
}
.sf-logo {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--foreground);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.025em;
  text-decoration: none;
  border-radius: var(--r-sm);
}
.sf-logo img { display: block; width: auto; height: 1.75rem; }

.sf-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1.5rem; }
.sf-col h2 {
  margin: 0 0 .75rem;
  color: var(--foreground);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.sf-col ul { display: grid; gap: .15rem; margin: 0; padding: 0; list-style: none; }

.site-footer a:not(.sf-logo) {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  color: var(--foreground-muted);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: color .15s ease-out;
}
.site-footer a:not(.sf-logo):hover { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--brand); text-underline-offset: 4px; }
.site-footer a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.site-footer a[aria-current="page"] { color: var(--foreground); }

.site-footer-bottom {
  width: min(100%, 72rem);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .35rem 1.5rem;
  padding-top: 1.25rem;
  color: var(--foreground-muted);
  font-size: .8125rem;
}
.site-footer-bottom p { margin: 0; }

@media (min-width: 720px) {
  .site-footer-inner { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr); gap: 3rem; }
  .sf-cols { gap: 1.75rem 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .site-footer a:not(.sf-logo) { transition: none; }
}
