/* Unlimited Connections: one stylesheet for every page. System fonts only (fast first paint). */
:root {
  --bg: #fbf8f3; --card: #ffffff; --ink: #1c1a1f; --muted: #66606c; --line: #e8e1d6; --soft: #f3eee6; --tile: #efe9df;
  --tile-on: #4a4458; --tile-on-ink: #fff; --accent: #3d5bd9; --accent-ink: #fff; --go: #1c1a1f; --go-ink: #fff;
  --l0: #f4d35e; --l1: #9fd07c; --l2: #94bff0; --l3: #c7a2e8; --bad: #d9480f;
  --r: 14px; --wrap: 1080px; --shadow: 0 1px 2px rgba(28,26,31,.06), 0 8px 24px -12px rgba(28,26,31,.18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15141a; --card: #1e1d25; --ink: #f2eff6; --muted: #a8a2b3; --line: #2e2c38; --soft: #23222b; --tile: #2c2a35;
    --tile-on: #e9e4f2; --tile-on-ink: #15141a; --accent: #8ea2ff; --accent-ink: #15141a; --go: #f2eff6; --go-ink: #15141a;
    --l0: #d9b93f; --l1: #79b35a; --l2: #6f9fd6; --l3: #a882cc; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15141a; --card: #1e1d25; --ink: #f2eff6; --muted: #a8a2b3; --line: #2e2c38; --soft: #23222b; --tile: #2c2a35;
  --tile-on: #e9e4f2; --tile-on-ink: #15141a; --accent: #8ea2ff; --accent-ink: #15141a; --go: #f2eff6; --go-ink: #15141a;
  --l0: #d9b93f; --l1: #79b35a; --l2: #6f9fd6; --l3: #a882cc; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-underline-offset: 2px; }
img, svg { max-width: 100%; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 12px; top: 12px; z-index: 9; background: var(--card); padding: 8px 12px; border-radius: 8px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(1.4) blur(8px); }
.top .wrap { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.01em; font-size: 18px; white-space: nowrap; }
.mark { display: grid; grid-template-columns: 12px 12px; gap: 3px; } .mark i { width: 12px; height: 12px; border-radius: 3px; display: block; }
.mark i:nth-child(1) { background: var(--l0); } .mark i:nth-child(2) { background: var(--l1); } .mark i:nth-child(3) { background: var(--l2); } .mark i:nth-child(4) { background: var(--l3); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; padding: 7px 10px; border-radius: 9px; font-size: 15px; font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--soft); }
.iconbtn.menu { display: none; }
.tools { display: flex; gap: 6px; align-items: center; }
.iconbtn { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 9px; height: 36px; min-width: 36px; padding: 0 9px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
details.lang { position: relative; } details.lang summary { list-style: none; } details.lang summary::-webkit-details-marker { display: none; }
details.lang ul { position: absolute; right: 0; top: 42px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px; min-width: 180px; z-index: 6; }
details.lang a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; } details.lang a:hover { background: var(--soft); }
@media (max-width: 860px) {
  .nav { display: none; } .iconbtn.menu { display: inline-flex; margin-left: auto; }
  .nav.open { display: flex; position: absolute; left: 0; right: 0; top: 60px; flex-direction: column; align-items: stretch; background: var(--card); border-bottom: 1px solid var(--line); padding: 8px 12px 14px; box-shadow: var(--shadow); }
}

/* hero + game */
.hero { padding-block: 22px 8px; text-align: center; }
.kicker { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 4px; }
h1 { font-size: clamp(26px, 4.2vw, 38px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 6px; }
.lede { color: var(--muted); margin: 0 auto; max-width: 640px; font-size: 16px; }
.board { max-width: 600px; margin: 14px auto 8px; }
.modes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 0; }
.modes a { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink); background: var(--soft); border-radius: 99px; padding: 6px 12px; }
.modes a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.uc-game { position: relative; }
.uc-solved { display: grid; gap: 8px; margin-bottom: 8px; }
.uc-row { border-radius: var(--r); padding: 12px 10px; text-align: center; color: #1c1a1f; animation: rise .35s ease; }
.uc-row b { display: block; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.uc-row span { font-size: 15px; text-transform: uppercase; }
.uc-row.l0 { background: var(--l0); } .uc-row.l1 { background: var(--l1); } .uc-row.l2 { background: var(--l2); } .uc-row.l3 { background: var(--l3); }
.uc-row.revealed { opacity: .85; }
.uc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; container-type: inline-size; } .uc-tile { min-width: 0; }
.uc-tile { aspect-ratio: 1.55; min-height: 64px; border: 0; border-radius: var(--r); background: var(--tile); color: var(--ink); font: inherit; font-weight: 800; --fs: 16px; font-size: var(--fs); font-size: min(var(--fs), max(8px, calc((25cqi - 16px) / (var(--n, 6) * .7)))); text-transform: uppercase; cursor: pointer; padding: 4px; line-height: 1.1; overflow-wrap: normal; word-break: normal; hyphens: manual; transition: transform .12s ease, background .12s ease; user-select: none; -webkit-tap-highlight-color: transparent; }
.uc-tile:hover { filter: brightness(.97); } .uc-tile:active { transform: scale(.97); }
.uc-tile.on { background: var(--tile-on); color: var(--tile-on-ink); }
.uc-tile.hinted { box-shadow: inset 0 0 0 3px var(--accent); }
.uc-tile.shake { animation: shake .35s ease; } .uc-tile.pop { animation: pop .35s ease; }
.uc-tile:focus-visible, .uc-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.uc-status { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 14px 0 6px; font-size: 15px; color: var(--muted); }
.uc-dots { display: inline-flex; gap: 7px; } .uc-dots i { width: 13px; height: 13px; border-radius: 50%; background: var(--tile-on); display: block; } .uc-dots i.used { background: var(--line); }
.uc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.uc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.uc-btn { border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 99px; padding: 10px 18px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.uc-btn:disabled { opacity: .4; cursor: default; }
.uc-btn.uc-go { background: var(--go); color: var(--go-ink); border-color: var(--go); }
.uc-toast { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; margin: 0; z-index: 3; }
.uc-toast.show { opacity: 1; }
.uc-result { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-top: 10px; box-shadow: var(--shadow); }
.uc-result h3 { margin: 0 0 4px; font-size: 22px; } .uc-result h3:focus { outline: none; } .uc-next { margin: 12px 0 0; color: var(--muted); font-size: 14px; } .uc-next b { color: var(--ink); font-variant-numeric: tabular-nums; } .uc-sum { color: var(--muted); margin: 0 0 8px; }
.uc-share { font-size: 22px; line-height: 1.15; margin: 6px 0 10px; font-family: inherit; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes pop { 50% { transform: translateY(-6px); } }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 480px) { .uc-grid { gap: 6px; } .uc-tile { --fs: 13.5px; aspect-ratio: 1.15; min-height: 0; } .uc-btn { padding: 9px 14px; font-size: 14px; } }
.stats { display: flex; justify-content: center; gap: 18px; color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.stats b { color: var(--ink); font-size: 18px; display: block; text-align: center; }

/* content */
main .prose { max-width: 760px; margin: 0 auto; padding-block: 10px 20px; }
.prose h2 { font-size: 25px; line-height: 1.25; letter-spacing: -.01em; margin: 36px 0 8px; }
.prose h3 { font-size: 19px; margin: 24px 0 6px; }
.prose p, .prose li { color: var(--ink); } .prose ul, .prose ol { padding-left: 22px; } .prose li { margin: 5px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; font-size: 14px; }
.prose blockquote { margin: 14px 0; padding: 10px 16px; background: var(--soft); border-radius: 12px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-weight: 700; font-size: 14px; color: #1c1a1f; }
.chip.l0 { background: var(--l0); } .chip.l1 { background: var(--l1); } .chip.l2 { background: var(--l2); } .chip.l3 { background: var(--l3); }
.example { display: grid; gap: 6px; margin: 12px 0; }
.example div { border-radius: 10px; padding: 8px 12px; color: #1c1a1f; font-size: 15px; } .example b { text-transform: uppercase; font-size: 13px; letter-spacing: .04em; display: block; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; } .faq summary { cursor: pointer; font-weight: 700; } .faq p { margin: 8px 0 0; }
details.reveal { background: var(--soft); border-radius: 12px; padding: 10px 14px; margin: 10px 0; } details.reveal summary { cursor: pointer; font-weight: 700; }
.crumbs { font-size: 14px; color: var(--muted); padding-top: 12px; } .crumbs a { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 14px 0; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.card b { display: block; font-size: 17px; margin-bottom: 2px; } .card span { color: var(--muted); font-size: 14px; line-height: 1.45; display: block; }
.card:hover { border-color: var(--accent); }
section.more { max-width: var(--wrap); margin: 0 auto; padding: 0 18px 20px; } section.more h2 { font-size: 22px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 420px; margin: 10px 0 18px; text-align: center; font-size: 14px; }
.cal b { color: var(--muted); font-size: 12px; font-weight: 600; } .cal a, .cal span { padding: 6px 0; border-radius: 8px; display: block; }
.cal a { background: var(--soft); color: var(--ink); text-decoration: none; font-weight: 600; } .cal a:hover { background: var(--l2); color: #1c1a1f; } .cal a.today { background: var(--ink); color: var(--bg); }
.cal span { color: var(--line); }
.months { columns: 3 180px; } .months a { display: block; padding: 3px 0; }

/* creator */
.creator { max-width: 640px; margin: 8px auto 0; display: grid; gap: 10px; text-align: left; }
.creator fieldset { border: 0; border-radius: var(--r); padding: 10px 12px 12px; margin: 0; }
.creator fieldset.l0 { background: color-mix(in srgb, var(--l0) 35%, var(--card)); } .creator fieldset.l1 { background: color-mix(in srgb, var(--l1) 35%, var(--card)); }
.creator fieldset.l2 { background: color-mix(in srgb, var(--l2) 35%, var(--card)); } .creator fieldset.l3 { background: color-mix(in srgb, var(--l3) 35%, var(--card)); }
.creator legend { font-weight: 800; font-size: 14px; padding: 0; margin-bottom: 4px; }
.creator input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; font: inherit; font-size: 15px; background: var(--card); color: var(--ink); }
.creator .words { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
@media (max-width: 520px) { .creator .words { grid-template-columns: repeat(2, 1fr); } }
.creator .out { display: flex; gap: 8px; } .creator .out input { flex: 1; }
.err { color: var(--bad); font-weight: 600; min-height: 1.4em; margin: 0; }

/* footer */
footer { border-top: 1px solid var(--line); margin-top: 30px; padding: 26px 0 40px; color: var(--muted); font-size: 14px; }
footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; }
footer h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink); margin: 0 0 6px; }
footer ul { list-style: none; padding: 0; margin: 0; } footer li { margin: 4px 0; } footer a { color: var(--muted); text-decoration: none; } footer a:hover { color: var(--ink); }
footer .legal { margin-top: 18px; font-size: 13px; }

[hidden] { display: none !important; }

.uc-tile.squeeze { overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .top .wrap { gap: 8px; } .brand { font-size: 16px; gap: 8px; } .tools { gap: 4px; }
  .iconbtn { padding: 0 7px; white-space: nowrap; }
}
@media (max-width: 370px) { .brand .b1 { display: none; } .top .wrap { gap: 6px; } .iconbtn { padding: 0 6px; } }
.board-static { margin: 14px auto 10px; max-width: 560px; } .board-static .uc-tile { cursor: default; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .top, footer, .more, .crumbs, nav.modes, .uc-btn, details.reveal, .lang { display: none !important; }
  body { background: #fff; color: #000; } .prose { max-width: none; }
  .board-static { break-inside: avoid; } .board-static .uc-tile { background: #fff !important; border: 1.5px solid #000; color: #000; }
  .example > div { border: 1px solid #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
