/* Ludo Mafia: clay noir.
   A toy town of the 1930s in modelling clay, at dusk. Ivory slabs with a
   brass rim carry the words in espresso ink; text straight on a picture is
   white with a soft shade; one gold main action per screen. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* the town at night */
  --sky: #0e1331;
  --street: #23294d;
  --street-lo: #181c3a;
  /* slabs that carry words */
  --ivory: #f8efdc;
  --ivory-hi: #fffbf0;
  --ivory-lo: #eadcbd;
  --ivory-edge: #cdb78c;
  /* the rim */
  --brass: #c9a14a;
  --brass-hi: #eed595;
  --brass-lo: #8e6a22;
  /* writing on ivory */
  --ink: #241a14;
  --ink-soft: rgba(36, 26, 20, 0.74);
  --line: rgba(36, 26, 20, 0.14);
  --well: rgba(36, 26, 20, 0.06);
  /* the one main action */
  --sun: #f0bc3c;
  --sun-hi: #f9da80;
  --sun-lo: #b8851a;
  /* alerts */
  --oxblood: #a8243a;
  --oxblood-lo: #741528;
  --shade: rgba(8, 6, 24, 0.6);

  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --text: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 26px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--street);
}

body {
  margin: 0;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ivory);
  background: var(--street);
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ivory);
  color: var(--ink);
  border: 2px solid var(--brass);
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem); }
h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: 0; }
p { margin: 0; }

/* ---------- the slab: ivory with a brass rim, a clay edge underneath ---------- */

.slab {
  background: var(--ivory);
  color: var(--ink);
  border: 3px solid var(--brass);
  border-radius: var(--radius);
  box-shadow:
    inset 0 2px 0 var(--ivory-hi),
    inset 0 -3px 0 var(--ivory-lo),
    0 7px 0 var(--brass-lo);
  padding: clamp(22px, 4vw + 8px, 44px);
}
.slab a { color: var(--ink); text-decoration-color: var(--brass); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.slab a:hover { text-decoration-color: var(--ink); }
.slab p + p { margin-top: 0.9em; }
.slab .lede { color: var(--ink-soft); }

/* ---------- buttons ---------- */

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 30px 13px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  background: var(--sun);
  border: 2px solid var(--sun-lo);
  border-radius: 18px;
  box-shadow: inset 0 3px 0 var(--sun-hi), 0 5px 0 var(--sun-lo);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
  -webkit-tap-highlight-color: transparent;
}
.btn-gold:active {
  transform: translateY(4px);
  box-shadow: inset 0 3px 0 var(--sun-hi), 0 1px 0 var(--sun-lo);
}

/* store plates: small ivory signs; links once a store is live (see site.js) */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.store {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 18px 13px;
  background: var(--ivory-hi);
  color: var(--ink);
  border: 2px solid var(--ivory-edge);
  border-radius: 16px;
  text-decoration: none;
}
.store-small { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.3; }
.store-name { font-family: var(--display); font-weight: 900; font-size: 1.35rem; line-height: 1.15; }
.store:not(a) { border-style: dashed; }
a.store {
  border: 2px solid var(--brass);
  box-shadow: 0 4px 0 var(--brass-lo);
}
a.store:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--brass-lo); }

/* ---------- home: the hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px calc(max(23vw, 31vh) + 18px);
  padding: clamp(18px, 4svh, 40px) 20px calc(max(23vw, 31svh) + 18px);
  background: var(--sky);
  color: #fff;
  overflow: hidden;
}
.hero-art, .hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero-art img { object-fit: cover; object-position: 50% 100%; }

.lang {
  align-self: flex-end;
  padding: 6px 14px 7px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: var(--ivory);
  border: 2px solid var(--brass);
  border-radius: 999px;
}

.hero h1 { margin-top: clamp(4px, 2svh, 24px); }
.hero h1 img {
  width: min(64vw, 340px);
  width: min(64vw, 30svh * 1.53, 340px);
  margin: 0 auto;
  filter: drop-shadow(0 6px 10px rgba(8, 6, 24, 0.45));
}
.tagline {
  margin-top: clamp(10px, 2svh, 20px);
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.55rem, 1.1rem + 2.6vw, 2.6rem);
  line-height: 1.12;
  text-wrap: balance;
  text-shadow: 0 2px 10px var(--shade), 0 1px 2px var(--shade);
  max-width: 18em;
}
.hero-text {
  margin-top: 12px;
  max-width: 34em;
  font-size: 1.05rem;
  line-height: 1.5;
  text-shadow: 0 1px 8px var(--shade), 0 1px 2px var(--shade);
}
.hero .btn-gold { margin-top: clamp(16px, 3svh, 28px); }
.hero-soon {
  margin-top: 12px;
  font-size: 0.98rem;
  font-weight: 600;
  text-shadow: 0 1px 6px var(--shade), 0 1px 2px var(--shade);
}

@media (prefers-reduced-motion: no-preference) {
  .hero h1 img { animation: settle 700ms cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
  @keyframes settle {
    from { transform: translateY(-18px) scale(0.96); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

/* ---------- home: the street of slabs ---------- */

.street {
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 16px 56px;
  display: grid;
  gap: 34px;
}

.intro { display: grid; gap: 22px; align-items: center; }
.intro img { width: min(260px, 70%); margin: 0 auto; }
.intro h2 { margin-bottom: 14px; }
.intro p { max-width: 36em; }

.modes h2 { margin-bottom: 8px; }
.mode-list { list-style: none; margin: 0; padding: 0; display: grid; }
.mode-list li {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.mode-list li:first-child { border-top: 0; }
.mode-list img { width: 104px; }
.mode-list h3 { margin-bottom: 4px; }
.mode-list p { color: var(--ink-soft); }

.boards { display: grid; gap: 24px; }
.boards h2 { margin-bottom: 14px; }
.board-pic {
  border-radius: 18px;
  border: 3px solid var(--ink);
  box-shadow: 0 5px 0 var(--well);
  width: min(100%, 440px);
  margin: 0 auto;
}
.board-names { font-family: var(--display); font-weight: 700; font-size: 1.2rem; margin: 6px 0 10px; }
.shelf {
  grid-column: 1 / -1;
  margin: 6px -6px 0;
}
.shelf-row {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  padding: 0 6px;
}
.shelf-row img {
  width: auto;
  height: clamp(120px, 18vw, 170px);
  max-width: none;
}
.shelf-board {
  height: 14px;
  margin: 0 6px;
  background: var(--brass);
  border-radius: 6px;
  box-shadow: inset 0 3px 0 var(--brass-hi), 0 4px 0 var(--brass-lo);
}
.shelf p { margin: 14px 6px 0; }

.pair { display: grid; gap: 34px; }
.pair h2 { margin-bottom: 12px; }
.perks { margin: 14px 0 0; padding: 0; list-style: none; }
.perks li { padding: 10px 0 10px 30px; border-top: 1px solid var(--line); position: relative; }
.perks li:first-child { border-top: 0; }
.perks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.95em;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: inset 0 2px 0 var(--sun-hi), 0 2px 0 var(--sun-lo);
}
.perks strong { font-weight: 700; }
.fine { margin-top: 14px; font-size: 0.95rem; color: var(--ink-soft); }

.get h2 { margin-bottom: 18px; }
.get .stores { margin-bottom: 18px; }

@media (min-width: 760px) {
  .intro { grid-template-columns: 1.5fr 1fr; }
  .intro img { width: 100%; max-width: 300px; order: 2; }
  .mode-list { grid-template-columns: 1fr 1fr; column-gap: 36px; }
  .mode-list li:nth-child(2) { border-top: 0; }
  .mode-list li { grid-template-columns: 120px 1fr; }
  .mode-list img { width: 120px; }
  .boards { grid-template-columns: 1fr 1fr; align-items: center; column-gap: 40px; }
  .pair { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ---------- inner pages ---------- */

.top {
  max-width: 840px;
  margin: 0 auto;
  padding: 22px 16px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.top img { width: 132px; }
.top-home {
  color: var(--ivory);
  font-weight: 600;
  font-size: 0.98rem;
  text-underline-offset: 3px;
}

.page {
  max-width: 840px;
  margin: 0 auto;
  padding: 16px 16px 56px;
}
.page .slab { padding: clamp(22px, 4vw + 6px, 48px); }
.page h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 2.8rem); margin-bottom: 8px; color: var(--ink); }
.page h2 { font-size: 1.45rem; margin: 2em 0 0.5em; }
.page p, .page li { max-width: 66ch; }
.page p { margin-bottom: 0.75em; }
.page ul, .page ol { padding-left: 1.3em; margin: 0.4em 0 1em; }
.page li { margin-bottom: 0.45em; }
.page li::marker { color: var(--brass-lo); }
.date { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1.6em !important; }

.note {
  background: var(--ivory-hi);
  border: 2px solid var(--ivory-edge);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 1.2em 0;
}
.note p:last-child { margin-bottom: 0; }
.note-warn { border-color: var(--oxblood); border-left-width: 8px; }
.note-warn strong { color: var(--oxblood-lo); }

.steps { counter-reset: none; }
.steps li { padding-left: 4px; }

.table-wrap { overflow-x: auto; margin: 0.8em 0 1.2em; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.98rem; min-width: 480px; }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.data-table th { font-family: var(--display); font-weight: 700; font-size: 1.02rem; border-bottom: 2px solid var(--brass); }
.data-table td.deleted { color: var(--oxblood-lo); font-weight: 600; }

/* ---------- invitation and password cards ---------- */

.scene {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  background: var(--sky);
}
.scene-art, .scene-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.scene-art img { object-fit: cover; object-position: 50% 40%; }
.card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.card .card-logo { width: 170px; margin: -4px auto 14px; }
.card h1 { font-size: 1.75rem; margin: 4px 0 8px; color: var(--ink); }
.card .sub { color: var(--ink-soft); margin: 0 0 20px; }
.badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 14px 5px;
  border-radius: 999px;
  background: var(--well);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
}
.code {
  display: inline-block;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.8rem;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: var(--ivory-hi);
  border: 2px dashed var(--brass);
  border-radius: 14px;
  padding: 6px 14px 8px 20px;
  margin: -4px 0 20px;
}
.card .btn-gold { display: flex; width: 100%; }
.hint { color: var(--ink-soft); font-size: 0.92rem; margin: 14px 0 18px; line-height: 1.45; }
.divider { height: 1px; background: var(--line); margin: 4px 0 16px; }
.stores-label { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 10px; }
.card .stores { gap: 10px; }
.card .store { flex: 1 1 140px; align-items: center; padding: 11px 10px; }
.card .store .store-name { font-size: 1.1rem; }

/* ---------- footer ---------- */

.foot {
  background: var(--street-lo);
  color: var(--ivory);
  padding: 34px 16px 40px;
  border-top: 3px solid var(--brass-lo);
}
.foot-inner { max-width: 1080px; margin: 0 auto; display: grid; gap: 14px; }
.foot nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot a { color: var(--ivory); text-underline-offset: 3px; }
.foot a:hover { color: var(--brass-hi); }
.foot p { color: rgba(248, 239, 220, 0.78); font-size: 0.95rem; }
.foot .mail { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ivory); }

/* ---------- not found ---------- */

.lost { text-align: center; }
.lost .slab { max-width: 520px; margin: 0 auto; }
.lost .slab img { width: 170px; margin: 0 auto 16px; }
.lost h1 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.4rem); margin-bottom: 10px; }
.lost p { margin: 0 auto 20px; max-width: 30em; }
.lost .also { margin: 20px auto 0; font-size: 0.95rem; color: var(--ink-soft); }

.card p { color: var(--ink-soft); }
.card p + p { margin-top: 0.8em; }
