/* Game of Sudoku tutorial. Same page layout as the dsResto tutorial, in the app's violet / pink brand colours. */
:root {
  --bg: #f8f5ff;
  --surface: #ffffff;
  --ink: #241a3d;
  --muted: #5c5278;
  --primary: #6a2fd6;
  --primary-ink: #ffffff;
  --pink: #d62f94;
  --tint: #ece3ff;
  --line: #dcd0f3;
  --tip: #e6f4ea;
  --tip-line: #7cc08f;
  --warn: #fff4e0;
  --warn-line: #e0a030;
  --bezel: #1c1530;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #150f24;
    --surface: #1f1736;
    --ink: #ece6fa;
    --muted: #b0a4cf;
    --primary: #b79bff;
    --primary-ink: #1b0e3d;
    --pink: #ff7ac6;
    --tint: #2e2250;
    --line: #3a2d63;
    --tip: #143323;
    --tip-line: #3d8a58;
    --warn: #3a2c10;
    --warn-line: #b07d20;
    --bezel: #0c0817;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--primary); }
header.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #7b2ff7, #e83ea4);
  color: #fff;
}
header.top strong { font-size: 18px; }
header.top .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
header.top .brand img { width: 32px; height: 32px; border-radius: 8px; display: block; }
header.top .brand > span { display: flex; align-items: baseline; gap: 8px; }
header.top .links { margin-left: auto; display: flex; gap: 6px; }
header.top .links a { font-size: 14px; font-weight: 600; text-decoration: none; padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.55); color: #fff; }
header.top .links a:hover { background: rgba(255,255,255,.2); }
header.top .sub { color: rgba(255,255,255,.85); font-size: 14px; }
.next { background: var(--tint); border-radius: 12px; padding: 14px 18px; margin: 24px 0 12px; }
.next .btn { padding: 4px 12px; text-decoration: none; margin: 4px 6px 4px 0; }
#menuBtn {
  display: none; margin-left: auto;
  border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.16); color: #fff;
  border-radius: 8px; padding: 6px 12px; font: inherit;
}
.layout { display: flex; max-width: 1180px; margin: 0 auto; }
nav.toc {
  flex: 0 0 250px; position: sticky; top: 57px; align-self: flex-start;
  height: calc(100vh - 57px); overflow-y: auto; padding: 20px 12px 40px 16px;
  font-size: 14px;
}
nav.toc h4 { margin: 18px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
nav.toc a { display: block; padding: 4px 8px; border-radius: 6px; text-decoration: none; color: var(--ink); }
nav.toc a:hover, nav.toc a.on { background: var(--tint); color: var(--primary); }
main { flex: 1; min-width: 0; padding: 20px 20px 80px; }
h1 { font-size: 30px; margin: 4px 0 8px; }
h2 { font-size: 24px; margin: 36px 0 6px; padding-top: 8px; border-top: 3px solid var(--primary); }
h3 { font-size: 18px; margin: 28px 0 6px; }
p.lead { font-size: 18px; color: var(--muted); }
.step { display: flex; gap: 24px; align-items: flex-start; margin: 18px 0; }
.step .txt { flex: 1; min-width: 0; }
.step.flip { flex-direction: row-reverse; }
figure { margin: 0; flex: 0 0 240px; }
figure img { display: block; width: 100%; height: auto; cursor: zoom-in; }
/* a full screen: phone bezel */
figure.phone img { width: 240px; border: 6px solid var(--bezel); border-radius: 22px; background: #fff; }
/* part of a screen or a dialog: simple rounded card */
figure.crop { flex: 0 0 300px; }
figure.crop img { width: 300px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
figure.wide { flex: 0 0 auto; width: 100%; max-width: 520px; }
figure.wide img { width: 100%; border: 2px solid var(--line); border-radius: 14px; }
figure.phone.small img { width: 200px; }
figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }
.pair { display: flex; gap: 14px; flex: 0 0 auto; align-items: flex-start; }
.pair figure.crop { flex: 0 0 250px; }
.pair figure.crop img { width: 250px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; margin: 16px 0; align-items: flex-start; }
.row figure.crop { flex: 0 0 min(300px, 46%); }
.row figure.crop img { width: 100%; }
ol, ul { padding-left: 22px; }
li { margin: 4px 0; }
.tip, .warn { border-left: 4px solid; border-radius: 6px; padding: 8px 14px; margin: 14px 0; }
.tip { background: var(--tip); border-color: var(--tip-line); }
.warn { background: var(--warn); border-color: var(--warn-line); }
table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 15px; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--tint); }
kbd, .btn {
  display: inline-block; padding: 0 8px; border: 1px solid var(--primary); color: var(--primary);
  border-radius: 12px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.btn.fill { background: var(--primary); color: var(--primary-ink); }
.stage { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; background: #6a45d1; color: #fff; font-weight: 700; font-size: 14px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; border: 1px solid rgba(0,0,0,.25); }
.chip { display: inline-block; padding: 0 8px; border-radius: 10px; background: var(--tint); color: var(--primary); font-size: 12px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.small { font-size: 13px; color: var(--muted); }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; white-space: pre-line; font-size: 15px; max-width: 440px; }
ol.quick { counter-reset: q; list-style: none; padding: 0; }
ol.quick li { counter-increment: q; position: relative; padding: 10px 14px 10px 52px; margin: 8px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
ol.quick li::before { content: counter(q); position: absolute; left: 12px; top: 9px; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 14px 0 20px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--primary); background: var(--tint); }
.card .g { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card b { font-size: 16px; color: var(--primary); }
.card span:last-child { font-size: 14px; color: var(--muted); }
.diagrams { display: flex; gap: 22px; flex-wrap: wrap; margin: 16px 0; }
.diagrams figure { flex: 0 1 210px; }
.diagrams svg { width: 100%; height: auto; display: block; border-radius: 6px; }
.hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 8px; }
.hero img { width: 96px; height: 96px; border-radius: 22px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 40px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; gap: 2px; max-width: 48%; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; }
.pager a:hover { border-color: var(--primary); background: var(--tint); }
.pager small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.pager .nxt { text-align: right; margin-left: auto; }
#lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none;
  align-items: center; justify-content: center; z-index: 50; cursor: zoom-out;
}
#lightbox.on { display: flex; }
#lightbox img { max-height: 94vh; max-width: 94vw; border-radius: 16px; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 16px; }
@media (max-width: 860px) {
  #menuBtn { display: block; }
  header.top .links { display: none; }
  nav.toc {
    display: none; position: fixed; top: 57px; left: 0; right: 0; bottom: 0;
    background: var(--surface); z-index: 9; height: auto;
  }
  nav.toc.open { display: block; }
  .layout { display: block; }
  main { padding: 16px 14px 60px; }
  .step, .step.flip { flex-direction: column; align-items: center; }
  .step .txt { width: 100%; }
  .pair { flex-wrap: wrap; justify-content: center; max-width: 100%; gap: 10px; }
  .pair figure.crop { flex: 0 1 220px; min-width: 0; }
  .pair figure.crop img { width: 100%; }
  figure.crop { flex: 0 1 300px; max-width: 100%; }
  figure.crop img { width: 100%; max-width: 320px; margin: 0 auto; }
  .row figure.crop { flex: 0 1 100%; }
  figure { min-width: 0; }
  main table { display: block; overflow-x: auto; }
  .pager a { max-width: 49%; padding: 8px 10px; }
  .pager b { font-size: 14px; }
}
@media print {
  header.top, nav.toc { display: none; }
}
