/*
  Club NYC: shared styles for the policy pages
  /rules.html, /privacy.html and /terms.html (no JavaScript).
  Palette, outlines and the display font match the game (app/src/style.css).
*/

/* The game's own faces, the same local files the game loads: Burbank Small Bold for headings, Medium for reading
   (with Bold for <strong> inside it) */
@font-face {
  font-family: 'Burbank Display';
  src: url('/fonts/BurbankSmall-Bold.otf') format('opentype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Burbank';
  src: url('/fonts/BurbankSmall-Medium.otf') format('opentype');
  font-weight: 100 599;
  font-display: swap;
}
@font-face {
  font-family: 'Burbank';
  src: url('/fonts/BurbankSmall-Bold.otf') format('opentype');
  font-weight: 600 900;
  font-display: swap;
}

:root {
  --ink: #1d2140;
  --paper: #fffdf6;
  --blue: #2a7bd5;
  --blue-dark: #134a96;
  --sun: #ffd166;
  --red: #e5483b;
  --white: #fff;
  --muted: #4b5272;
  --line: #ebe4cf;
  --sun-tint: #fff3cc;
  --blue-tint: #eaf3ff;
  --red-tint: #fde8e5;

  --display: 'Burbank Display', 'Lilita One', 'Arial Rounded MT Bold', ui-rounded, system-ui, sans-serif;
  --body: 'Burbank', 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --outline: 3px solid var(--ink);
  --radius: 20px;
  --gutter: 1rem;

  /* reading column: about 70-75 characters of 17px body text per line */
  --measure: 36rem;
  --toc-width: 16rem;
  --toc-gap: 3.5rem;

  color-scheme: light;
}

@media (min-width: 40rem) {
  :root { --gutter: 1.5rem; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p, li { text-wrap: pretty; }

a {
  color: var(--blue-dark);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 3px; }
a[href^="mailto:"] { overflow-wrap: anywhere; }

:focus-visible {
  outline: 3px solid var(--blue-dark);
  outline-offset: 3px;
}

strong { font-weight: 800; }

code {
  padding: 0.05em 0.35em;
  background: #f3eddc;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

address { font-style: normal; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -6rem;
  z-index: 10;
  padding: 0.4rem 1rem 0.5rem;
  background: var(--sun);
  color: var(--ink);
  border: var(--outline);
  border-radius: 999px;
  font-family: var(--display);
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* header, page and footer share one width, so the logo lines up with the text */
.wrap {
  width: 100%;
  max-width: calc(var(--measure) + var(--toc-gap) + var(--toc-width) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- header ---------- */
.site-header {
  background:
    repeating-linear-gradient(45deg, rgb(255 255 255 / 0.16) 0 14px, transparent 14px 28px),
    linear-gradient(180deg, #78bdf2, #bfe3fb);
}

/* taxi-checker band, as on a yellow cab */
.site-header::after,
.site-footer::before {
  content: "";
  display: block;
  height: 14px;
  background: conic-gradient(var(--ink) 90deg, var(--sun) 90deg 180deg, var(--ink) 180deg 270deg, var(--sun) 270deg) 0 0 / 14px 14px;
  border-block: var(--outline);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.6rem 0.85rem;
}

/* the logo PNG has wide transparent margins; this frame crops to the artwork */
.brand {
  position: relative;
  display: block;
  flex: none;
  width: clamp(9rem, 34vw, 12.5rem);
  aspect-ratio: 664 / 455;
  overflow: hidden;
  border-radius: 8px;
  transition: transform 0.15s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.brand img {
  position: absolute;
  left: -22.14%;
  top: -5.27%;
  width: 135.54%;
  max-width: none;
  height: auto;
}
.brand:hover { transform: rotate(-2deg) scale(1.03); }

.policy-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.policy-nav a {
  display: inline-block;
  padding: 0.3rem 0.9rem 0.4rem;
  background: var(--paper);
  color: var(--ink);
  border: var(--outline);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.1s;
}
.policy-nav a:hover { background: var(--white); transform: translateY(-1px); }
.policy-nav a:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.policy-nav a[aria-current="page"] { background: var(--sun); }

/* ---------- page layout ---------- */
main {
  display: block;
  padding-block: clamp(1.75rem, 1rem + 3vw, 3rem) 4rem;
}

.layout { max-width: var(--measure); }

/* wide screens: the table of contents becomes a sticky sidebar */
@media (min-width: 64rem) {
  .layout {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) var(--toc-width);
    grid-template-areas:
      "intro toc"
      "body  toc";
    column-gap: var(--toc-gap);
    justify-content: space-between;
    align-items: start;
    max-width: none;
  }
  .intro { grid-area: intro; }
  .sections { grid-area: body; }
  .toc {
    grid-area: toc;
    position: sticky;
    top: 1.25rem;
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    margin: 0;
    font-size: 0.95rem;
  }
}

/* ---------- title block ---------- */
.intro { margin-bottom: 2rem; }

h1 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.55rem + 2.4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.meta {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-weight: 700;
}

.early-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.65rem 0.2rem;
  background: var(--sun);
  color: var(--ink);
  border: var(--outline);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

/* "The short version" */
.short-version {
  padding: 1.15rem 1.25rem 0.7rem;
  background: var(--sun-tint);
  border: var(--outline);
  border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--ink);
}
.short-version h2 {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.15;
}
.short-version ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.short-version li {
  position: relative;
  margin: 0 0 0.55rem;
  padding-left: 1.65rem;
  line-height: 1.55;
}
.short-version li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.42em;
  width: 0.8rem;
  height: 0.8rem;
  background: var(--blue);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

/* ---------- table of contents ---------- */
.toc {
  margin: 0 0 2.75rem;
  padding: 1rem 1.15rem 1.1rem;
  background: var(--blue-tint);
  border: var(--outline);
  border-radius: var(--radius);
}
.toc h2 {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.2;
}
.toc ol {
  margin: 0;
  padding-left: 1.75rem;
}
.toc li {
  margin: 0.2rem 0;
  padding-left: 0.15rem;
  line-height: 1.4;
}
.toc li::marker {
  color: var(--blue-dark);
  font-family: var(--display);
}
.toc a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.toc a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}

/* ---------- numbered sections ---------- */
.sections > section {
  margin: 0 0 2.75rem;
  scroll-margin-top: 1rem;
}
.sections > section:last-child { margin-bottom: 0; }

.sections h2 {
  display: flex;
  align-items: flex-start;
  gap: 0.35em;
  margin: 0 0 0.85rem;
  color: var(--blue-dark);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.45rem, 1.25rem + 0.9vw, 1.85rem);
  line-height: 1.15;
  text-wrap: balance;
}

/* number badge, sized to the heading's first line so long titles can wrap */
.num {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 2em;
  height: 2em;
  padding: 0 0.3em;
  background: var(--sun);
  color: var(--ink);
  border: var(--outline);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  font-size: 0.58em;
  line-height: 1;
}
section:target .num {
  background: var(--blue-dark);
  color: var(--white);
}

.sections h3 {
  margin: 1.6rem 0 0.45rem;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.25;
}
.sections h2 + h3,
.sections h2 + p + h3 { margin-top: 1rem; }

.sections p { margin: 0 0 1rem; }

.sections ul,
.sections ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}
.sections li {
  margin: 0 0 0.45rem;
  padding-left: 0.15rem;
}
.sections li::marker { color: var(--blue-dark); }

.lead {
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.3;
}

.small {
  color: var(--muted);
  font-size: 0.93rem;
}

/* a step in the game's UI, e.g. Player card > Settings */
.ui {
  display: inline-block;
  padding: 0 0.4rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 2px 0 var(--ink);
  font-weight: 800;
  font-size: 0.92em;
  line-height: 1.5;
  white-space: nowrap;
}

/* ---------- boxes ---------- */
.callout {
  margin: 1.25rem 0 1.5rem;
  padding: 0.95rem 1.15rem;
  background: var(--blue-tint);
  border: var(--outline);
  border-radius: 16px;
  scroll-margin-top: 1rem;
}
.callout > :last-child { margin-bottom: 0; }
.callout ul { margin-bottom: 0; }

.callout-title {
  display: block;
  margin: 0 0 0.3rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.25;
}

.callout.sun { background: var(--sun-tint); }

.callout.alert {
  padding-left: 1.6rem;
  background: linear-gradient(90deg, var(--red) 0 0.6rem, var(--red-tint) 0.6rem);
  box-shadow: 0 4px 0 var(--ink);
}
.callout:target { outline: 3px solid var(--blue-dark); outline-offset: 4px; }

/* plain-language legal statements that need to stand out (Terms) */
.legal-box {
  margin: 1.25rem 0;
  padding: 1rem 1.15rem;
  background: var(--white);
  border: var(--outline);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 700;
}
.legal-box > :last-child { margin-bottom: 0; }

.contact-card {
  display: inline-block;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: var(--outline);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  line-height: 1.6;
}

/* ---------- tables (Privacy: how long we keep it) ---------- */
.table-wrap {
  margin: 1.25rem 0 1.5rem;
  overflow-x: auto;
  background: var(--white);
  border: var(--outline);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--ink);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
  line-height: 1.5;
}
th, td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: top;
}
thead th {
  background: var(--blue-dark);
  color: var(--white);
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
tbody th {
  width: 52%;
  font-weight: 800;
}
tbody tr + tr > * { border-top: 2px solid var(--line); }

/* ---------- moderation ladder (Rules) ---------- */
.sections .ladder {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.sections .ladder li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 0.8rem 1rem 0.85rem 3.35rem;
  border: var(--outline);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  line-height: 1.45;
}
.ladder li::before {
  content: counter(step);
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  background: var(--paper);
  border: var(--outline);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 0.95rem;
  line-height: 1;
}
.ladder li:nth-child(1) { background: #fff7dc; }
.ladder li:nth-child(2) { background: #ffe8b3; }
.ladder li:nth-child(3) { background: #ffd5c2; }
.ladder li:nth-child(4) { background: #ffc0b5; }
.ladder .step {
  display: block;
  margin-bottom: 0.15rem;
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.2;
}

@media (min-width: 48rem) {
  .sections .ladder {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }
  .sections .ladder li {
    padding: 3.1rem 0.85rem 0.9rem;
    font-size: 0.95rem;
  }
  .ladder li:nth-child(1) { min-height: 9rem; }
  .ladder li:nth-child(2) { min-height: 10.25rem; }
  .ladder li:nth-child(3) { min-height: 11.5rem; }
  .ladder li:nth-child(4) { min-height: 12.75rem; }
}

.signoff {
  margin-top: 2.5rem;
  color: var(--blue-dark);
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.3;
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.95rem;
}
.site-footer .wrap { padding-block: 2rem 2.5rem; }
.site-footer a { color: var(--sun); }
.site-footer :focus-visible { outline-color: var(--sun); }

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.footer-nav a {
  font-family: var(--display);
  font-size: 1.1rem;
  text-decoration: none;
}
.footer-nav a:hover { text-decoration: underline; }
.footer-nav a[aria-current="page"] { color: var(--paper); }

.site-footer .play-btn {
  display: inline-block;
  padding: 0.45rem 1.15rem 0.55rem;
  background: var(--sun);
  color: var(--ink);
  border-radius: 16px;
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.5), 0 4px 0 #0b0e22;
  transition: transform 0.1s;
}
.site-footer .play-btn:hover { text-decoration: none; transform: translateY(-1px); }
.site-footer .play-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0b0e22; }

.footer-note { margin: 0 0 0.5rem; color: #e3e5f3; }
.footer-fine { margin: 0; color: #b9bed8; font-size: 0.85rem; }

/* ---------- motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .brand:hover,
  .policy-nav a:hover,
  .site-footer .play-btn:hover { transform: none; }
}

@media print {
  .skip-link,
  .site-header,
  .toc,
  .footer-nav,
  .site-footer::before { display: none; }
  body { background: var(--white); font-size: 11pt; }
  a { color: var(--ink); }
  .short-version,
  .callout,
  .legal-box,
  .contact-card,
  .table-wrap,
  .sections .ladder li { box-shadow: none; break-inside: avoid; }
  .site-footer { background: none; color: var(--ink); border-top: 2px solid var(--ink); }
  .site-footer a { color: var(--ink); }
}
