/* M73 — PixelPicked demo. Every colour, radius and type size below is a Logic Daily token:
   colours = LdColors light / dark (lib/theme/logic_daily_tokens.dart), dark Queens regions =
   LdRegionsLocal.dark (lib/theme/local/game.dart), Nonogram picture palette `teal`
   (lib/theme/local/pictures.dart), radii = LdRadius, type = LdText. Alpha = the token's 0xAA byte / 255. */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('fonts/HankenGrotesk-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #F5EFE4;
  --surface: #FFFBF4;
  --surface2: #EDE5D6;
  --line: #E2D8C6;
  --ink: #24201A;
  --ink2: #655B4B;
  --accent: #2C4A86;
  --on-accent: #FFFFFF;
  --accent-bg: #E1E6F1;
  --success: #2F6B43;
  --danger: #A8231B;
  --slab: #2A241D;
  --rim: rgba(0, 0, 0, 0);
  --groove: rgba(36, 32, 26, 0.13);
  --mark: rgba(36, 32, 26, 0.62);
  --queen: #24201A;
  --conflict-stripe: rgba(168, 35, 27, 0.24);
  --pattern-ink: rgba(36, 32, 26, 0.086);
  --press-overlay: rgba(36, 32, 26, 0.051);
  --nono-cell: #FFFBF4;
  --nono-fill: #2A241D;
  --nono-mark: rgba(36, 32, 26, 0.5);
  --grid-thin: rgba(36, 32, 26, 0.16);
  --grid-thick: rgba(36, 32, 26, 0.85);
  --clue: #24201A;
  --clue-dim: rgba(36, 32, 26, 0.64);
  --active-line: rgba(44, 74, 134, 0.1);
  --stamp: #2C4A86;
  --sheen: rgba(255, 255, 255, 0.55);
  --picture-bg: #FFFBF4;
  --pic-speck: #9B9132;
  --pic-top: #123F38;
  --pic-body: #2E7D6E;
  --pic-bottom: #21665B;
  --r0: #EDB7A5; --r1: #D9D188; --r2: #95B878; --r3: #98DDCB; --r4: #C6E0F6;
  --r5: #A7ABEA; --r6: #D8B6E0; --r7: #E697A3; --r8: #F9D8AE; --r9: #86B1BB;
  --card-shadow: 0 1px 0 rgba(36, 32, 26, 0.04), 0 1px 2px rgba(36, 32, 26, 0.06); /* approximates LdShadow.card */
  --radius-button: 16px; /* LdRadius.button */
  --radius-card: 18px;   /* LdRadius.card */
  --radius-small: 12px;  /* LdRadius.small */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #1A1815;
    --surface: #24211D;
    --surface2: #2E2A25;
    --line: #3A352E;
    --ink: #F2EADB;
    --ink2: #B8AD9A;
    --accent: #9DB4EC;
    --on-accent: #141210;
    --accent-bg: #2A3142;
    --success: #8CCB9C;
    --danger: #FF9C8E;
    --slab: #0F0D0B;
    --rim: rgba(243, 235, 221, 0.42);
    --groove: rgba(0, 0, 0, 0.32);
    --mark: rgba(243, 235, 221, 0.62);
    --queen: #F3EBDD;
    --conflict-stripe: rgba(255, 156, 142, 0.28);
    --pattern-ink: rgba(255, 248, 235, 0.075);
    --press-overlay: rgba(255, 255, 255, 0.059);
    --nono-cell: #24211D;
    --nono-fill: #F2EADB;
    --nono-mark: rgba(243, 235, 221, 0.5);
    --grid-thin: rgba(242, 234, 219, 0.12);
    --grid-thick: rgba(242, 234, 219, 0.62);
    --clue: #F2EADB;
    --clue-dim: rgba(242, 234, 219, 0.55);
    --active-line: rgba(157, 180, 236, 0.141);
    --stamp: #F0C46A;
    --sheen: rgba(255, 240, 210, 0.2);
    --picture-bg: #2E2A25;
    --pic-speck: #D9D188;
    --pic-top: #378275;
    --pic-body: #6CC2B0;
    --pic-bottom: #4DA392;
    --r0: #69412B; --r1: #7C5900; --r2: #3E5301; --r3: #136A5C; --r4: #2F445F;
    --r5: #4A5D9A; --r6: #60417F; --r7: #7B2E48; --r8: #715D44; --r9: #295865;
    --card-shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/22px 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif; /* LdText.body */
  -webkit-tap-highlight-color: transparent;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 28px;
}
@media (max-width: 359px) { .page { padding-inline: 12px; } }

/* Header ------------------------------------------------------------------------------------ */
.head { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.head .titles { flex: 1; min-width: 0; }
.wordmark { /* LdText.wordmark */
  margin: 0;
  font: 640 21px/26px 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 21, 'SOFT' 100, 'WONK' 0;
  letter-spacing: -0.2px;
}
.sub { margin: 0; font-size: 12.5px; line-height: 17px; color: var(--ink2); } /* LdText.subtitle */
.timer {
  min-width: 80px;
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font: 650 15px/20px 'Hanken Grotesk', sans-serif; /* LdText.timer */
  font-variant-numeric: tabular-nums;
}

/* Tabs and the Fill / Mark switch (SegmentedChoice) ------------------------------------------ */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin: 12px 0;
  background: var(--surface2);
  border-radius: 16px; /* LdRadius.segmentTrack */
}
.seg button {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--ink2);
  font: 700 14.5px/18px 'Hanken Grotesk', sans-serif; /* LdText.segment */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.seg button[aria-selected='true'], .seg button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--card-shadow);
}
.seg .tick { color: var(--success); font-weight: 800; }
.swatch { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
.swatch.fill { background: var(--nono-fill); }

/* Board area --------------------------------------------------------------------------------- */
.rules { margin: 0 0 12px; font-size: 13px; line-height: 18px; color: var(--ink2); }
.stage { position: relative; display: flex; justify-content: center; }
canvas.board { display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.status { margin: 12px 0; min-height: 20px; text-align: center; font: 600 13.5px/18px 'Hanken Grotesk', sans-serif; color: var(--ink2); font-variant-numeric: tabular-nums; }
.status.bad { color: var(--danger); }
.hint { margin: 0 0 12px; text-align: center; font-size: 12.5px; line-height: 17px; color: var(--ink2); }
.hint.after-tools { margin: 12px 0 0; }
.seg.flush { margin-top: 0; }

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-button);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--card-shadow);
  font: 650 15px/20px 'Hanken Grotesk', sans-serif; /* LdText.button */
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Win card + call to action ------------------------------------------------------------------- */
.win {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  text-align: center;
}
.win[hidden] { display: none; }
.win h2 { /* LdText.cardTitle */
  margin: 0;
  font: 620 18px/24px 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 18, 'SOFT' 100, 'WONK' 0;
}
.win p { margin: 4px 0 0; font-size: 13px; line-height: 18px; color: var(--ink2); }
.cta {
  margin-top: 12px;
  min-height: 52px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-button);
  background: var(--accent);
  color: var(--on-accent);
  font: 700 16px/21px 'Hanken Grotesk', sans-serif; /* LdText.buttonLarge */
  text-decoration: none;
}
.cta:focus-visible, .btn:focus-visible, .seg button:focus-visible, .foot a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.win .again { margin-top: 8px; background: none; border: 0; min-height: 48px; padding: 0 16px; color: var(--accent); font: 650 15px/20px 'Hanken Grotesk', sans-serif; cursor: pointer; }

.foot { margin-top: 20px; text-align: center; font-size: 13px; line-height: 18px; color: var(--ink2); }
.foot a { display: inline-block; min-height: 48px; line-height: 48px; padding: 0 8px; color: var(--accent); font-weight: 650; }

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