/* Lazy Sunday Games: the shared look. Every page loads this first, then maps its own
   variables onto these tokens, so one edit here re-themes the whole site.

   The look in one breath: newsprint and black ink with one red, Nunito throughout, flat
   backgrounds, and every box cut like a tile (tiny radius, thin edge, a grout line inside). */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("/assets/fonts/nunito.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  /* Day: newsprint and black ink */
  --ls-bg: #f3f0e8;
  --ls-surface: #fbf9f3;
  --ls-raised: #fffefb;
  --ls-well: #e8e3d6;
  --ls-ink: #1a1917;
  --ls-muted: #5c5850;
  --ls-line: #cdc6b7;
  --ls-line-strong: #857f72;

  /* The one loud color, and the text that sits on it. */
  --ls-accent: #c2311a;
  --ls-on-accent: #fffaf2;

  /* One hue per room. The plain tone is a soft fill that takes ink text. The deep tone is
     for marks that sit straight on the page, and for fills that take page-colored text. */
  --ls-apricot: #f0cdaf;
  --ls-apricot-deep: #96461a;
  --ls-blue: #bfd1e2;
  --ls-blue-deep: #27507a;
  --ls-sage: #c2d8bb;
  --ls-sage-deep: #2f6340;
  --ls-lavender: #d9cbe4;
  --ls-lavender-deep: #62457f;
  --ls-rose: #f0c6c6;
  --ls-rose-deep: #9a3340;
  --ls-butter: #ecdcab;
  --ls-butter-deep: #7a5a00;

  /* The room you are in. Pages set data-room on <html>. */
  --ls-hue: var(--ls-butter);
  --ls-hue-deep: var(--ls-butter-deep);

  /* Tiles: every box has a tiny radius, a thin edge and a grout line set in from it.
     The grout needs the box to be surface-colored with at least 10px of padding. */
  --ls-rad: 4px;
  --ls-rad-s: 2px;
  --ls-edge: color-mix(in srgb, var(--ls-ink) 30%, var(--ls-line));
  --ls-grout: inset 0 0 0 5px var(--ls-surface), inset 0 0 0 6px var(--ls-line);
  --ls-button: color-mix(in srgb, var(--ls-ink) 8%, var(--ls-surface));

  --ls-display: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ls-body: var(--ls-display);
  /* Small capital labels: use at weight 800 with a little tracking. */
  --ls-label: var(--ls-display);

  --ls-nav-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Evening: the same page with the lights down */
    --ls-bg: #161513;
    --ls-surface: #22201d;
    --ls-raised: #2a2824;
    --ls-well: #100f0e;
    --ls-ink: #ece8df;
    --ls-muted: #a8a295;
    --ls-line: #3d3a33;
    --ls-line-strong: #7d776b;

    --ls-accent: #ff7052;
    --ls-on-accent: #1a1210;

    --ls-apricot: #4a3220;
    --ls-apricot-deep: #f0a878;
    --ls-blue: #22384e;
    --ls-blue-deep: #9cc3e8;
    --ls-sage: #263f2c;
    --ls-sage-deep: #9fd0a8;
    --ls-lavender: #392c4a;
    --ls-lavender-deep: #c9b0e8;
    --ls-rose: #4c262b;
    --ls-rose-deep: #f0a3ac;
    --ls-butter: #453a18;
    --ls-butter-deep: #e8c160;
  }
}

:root[data-room="fidgets"] { --ls-hue: var(--ls-apricot); --ls-hue-deep: var(--ls-apricot-deep); }
:root[data-room="scribbles"] { --ls-hue: var(--ls-blue); --ls-hue-deep: var(--ls-blue-deep); }
:root[data-room="puzzles"] { --ls-hue: var(--ls-sage); --ls-hue-deep: var(--ls-sage-deep); }
:root[data-room="pixels"] { --ls-hue: var(--ls-lavender); --ls-hue-deep: var(--ls-lavender-deep); }
:root[data-room="keys"] { --ls-hue: var(--ls-rose); --ls-hue-deep: var(--ls-rose-deep); }

/* ---------- the menu bar across the top of every page ---------- */

.ls-nav {
  box-sizing: border-box;
  flex: none;
  width: 100%;
  height: var(--ls-nav-h);
  padding: 0 max(20px, calc((100% - 1220px) / 2));
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ls-surface);
  border-bottom: 4px solid var(--ls-ink);
  font-family: var(--ls-body);
  color: var(--ls-ink);
  -webkit-tap-highlight-color: transparent;
}
.ls-nav *, .ls-nav *::before, .ls-nav *::after { box-sizing: border-box; }
.ls-nav a { color: inherit; text-decoration: none; }
.ls-nav a:focus-visible { outline: 3px solid var(--ls-accent); outline-offset: 2px; }

.ls-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  padding: 6px 0;
  font: 900 22px/1 var(--ls-display);
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.ls-brand svg { width: 30px; height: 30px; flex: none; }
.ls-brand .ls-sun { fill: var(--ls-accent); }
.ls-brand .ls-rays, .ls-brand .ls-horizon { fill: none; stroke-linecap: round; }
.ls-brand .ls-rays { stroke: var(--ls-accent); stroke-width: 1.8; }
.ls-brand .ls-horizon { stroke: var(--ls-ink); stroke-width: 2; }
.ls-tag {
  padding: 4px 7px 3px;
  background: var(--ls-ink);
  color: var(--ls-bg);
  font: 800 10px/1 var(--ls-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ls-tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ls-tabs::-webkit-scrollbar { display: none; }
.ls-tabs a {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 9px;
  font: 800 15px/1.2 var(--ls-label);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ls-muted);
  transition: color 0.18s;
}
.ls-tabs a::before { content: "\25B6"; font-size: 0.62em; opacity: 0; }
.ls-tabs a:hover { color: var(--ls-ink); }
.ls-tabs a[aria-current="page"] { color: var(--ls-accent); }
.ls-tabs a[aria-current="page"]::before { opacity: 1; animation: ls-blink 1.1s steps(2, jump-none) infinite; }
@keyframes ls-blink { to { opacity: 0; } }

/* Sign in, or the signed-in player's rank and handle (assets/account.js fills it in). */
.ls-account {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 190px;
  margin-left: 6px;
  padding: 6px 10px;
  border: 1px solid var(--ls-edge);
  border-radius: var(--ls-rad-s);
  background: var(--ls-button);
  font: 800 13px/1.2 var(--ls-label);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.18s;
}
.ls-account:hover { background: color-mix(in srgb, var(--ls-ink) 14%, var(--ls-surface)); }
.ls-account[aria-current="page"] { border-color: var(--ls-accent); }
.ls-account span { overflow: hidden; text-overflow: ellipsis; }
.ls-account.is-in { text-transform: none; letter-spacing: 0; font-size: 14px; padding: 4px 10px 4px 6px; }
.ls-person { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

@media (max-width: 640px) {
  :root { --ls-nav-h: 54px; }
  .ls-account { margin-left: 2px; padding: 6px; }
  .ls-account.is-in { padding: 4px; }
  .ls-account span { display: none; }
  .ls-nav { padding: 0 10px; gap: 6px; }
  .ls-brand span { display: none; }
  .ls-tabs { gap: 0; }
  .ls-tabs a { padding: 8px 6px; font-size: 13px; letter-spacing: 0.03em; gap: 3px; }
  .ls-tabs a:not([aria-current="page"])::before { display: none; }
}
/* The five rooms and the account button share a phone's width, so they tighten in steps. */
@media (max-width: 440px) {
  .ls-nav { gap: 4px; }
  .ls-tabs a { padding: 8px 4px; font-size: 12px; letter-spacing: 0.02em; }
  .ls-account { margin-left: 0; padding: 4px; }
  .ls-person { width: 16px; height: 16px; }
}
@media (max-width: 384px) {
  .ls-nav { padding: 0 6px; gap: 3px; }
  .ls-brand svg { width: 24px; height: 24px; }
  .ls-tabs a { padding: 8px 2.5px; font-size: 11px; letter-spacing: 0; gap: 2px; }
}
@media (max-width: 330px) {
  .ls-tabs a { padding: 8px 2px; font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .ls-tabs a { transition: none; }
  .ls-tabs a[aria-current="page"]::before { animation: none; }
}

/* ---------- rank symbols (assets/rank-symbol.js) ---------- */
.ls-rank { display: inline-block; vertical-align: middle; flex: none; }
@media (prefers-color-scheme: dark) {
  /* The chevrons are drawn in the tier's dark shade, which sinks into the evening page. */
  .ls-rank polyline { stroke: var(--ls-rank-metal); }
}
