/* Technique guide pages. Diagram colours follow the app's roles:
   amber = the pattern, teal = the conclusion, indigo/purple = chain colours. */

.crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--ink-faint); padding: 24px 0 0;
}
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.crumb i { font-style: normal; opacity: .45; }

/* ---- technique page ---- */

.guide { padding-bottom: 40px; }
.guide-head { margin: 18px 0 28px; }
.guide-head h1 {
  font-size: clamp(28px, 4.6vw, 40px); letter-spacing: -.026em;
  margin: 0 0 12px; font-weight: 660;
}
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.badge {
  font-size: 12px; font-weight: 560; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-sunken); color: var(--ink-soft); border: 1px solid var(--line);
}
.badge.live { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 34%, transparent); }

.badge.tier-easy    { color: var(--tier-easy);    border-color: color-mix(in srgb, var(--tier-easy) 40%, transparent);    background: color-mix(in srgb, var(--tier-easy) 12%, transparent); }
.badge.tier-medium  { color: var(--tier-medium);  border-color: color-mix(in srgb, var(--tier-medium) 40%, transparent);  background: color-mix(in srgb, var(--tier-medium) 12%, transparent); }
.badge.tier-hard    { color: var(--tier-hard);    border-color: color-mix(in srgb, var(--tier-hard) 40%, transparent);    background: color-mix(in srgb, var(--tier-hard) 12%, transparent); }
.badge.tier-expert  { color: var(--tier-expert);  border-color: color-mix(in srgb, var(--tier-expert) 40%, transparent);  background: color-mix(in srgb, var(--tier-expert) 12%, transparent); }
.badge.tier-extreme { color: var(--tier-extreme); border-color: color-mix(in srgb, var(--tier-extreme) 40%, transparent); background: color-mix(in srgb, var(--tier-extreme) 12%, transparent); }

.guide .summary { font-size: 18px; color: var(--ink-soft); margin: 0; max-width: 60ch; }

.guide h2 { font-size: 20px; margin: 34px 0 12px; }
.steps { margin: 0; padding-left: 22px; }
.steps li { color: var(--ink-soft); margin-bottom: 12px; line-height: 1.62; padding-left: 4px; }

/* ---- diagram ---- */

.board-fig {
  margin: 28px 0 0; padding: 20px; background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.diagram { width: 100%; max-width: 430px; height: auto; display: block; margin: 0 auto; }

.diagram .cell { fill: var(--bg-raised); }
.diagram .cell.empty { fill: var(--bg-sunken); opacity: .55; }
/* Cell rules stay quiet; box boundaries carry real weight and real contrast,
   because the 3x3 structure is what makes a Sudoku diagram readable at all. */
.diagram .rule { stroke: color-mix(in srgb, var(--ink) 22%, transparent); stroke-width: 1; }
.diagram .rule.thick {
  stroke: color-mix(in srgb, var(--ink) 78%, transparent);
  stroke-width: 2.8; stroke-linecap: square;
}
.diagram .axis {
  fill: var(--ink-faint); font: 600 10px ui-sans-serif, system-ui, sans-serif;
  text-anchor: middle;
}
.diagram .given {
  fill: var(--ink); font: 600 22px ui-sans-serif, system-ui, sans-serif;
  text-anchor: middle;
}
.diagram .cand { fill: var(--ink-faint); font: 500 11px ui-sans-serif, system-ui, sans-serif; }
.diagram .cand.key { fill: var(--accent); font-weight: 700; }
.diagram .cand.gone { fill: var(--danger); }
.diagram .strike { stroke: var(--danger); stroke-width: 1.4; stroke-linecap: round; }

.diagram .f-pattern { fill: color-mix(in srgb, var(--brand-amber) 22%, var(--bg-raised)); }
.diagram .f-target  { fill: color-mix(in srgb, var(--accent) 26%, var(--bg-raised)); }
.diagram .f-linkA   { fill: color-mix(in srgb, var(--brand-indigo) 26%, var(--bg-raised)); }
.diagram .f-linkB   { fill: color-mix(in srgb, var(--tier-extreme) 24%, var(--bg-raised)); }

.legend { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.swatch.f-pattern { background: color-mix(in srgb, var(--brand-amber) 45%, transparent); }
.swatch.f-target  { background: color-mix(in srgb, var(--accent) 50%, transparent); }
.swatch.f-linkA   { background: color-mix(in srgb, var(--brand-indigo) 50%, transparent); }
.swatch.f-linkB   { background: color-mix(in srgb, var(--tier-extreme) 50%, transparent); }
.swatch.gone-swatch { background: color-mix(in srgb, var(--danger) 50%, transparent); }

/* ---- pager + back link ---- */

.pager {
  display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  margin: 36px 0 0; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.pager a { color: var(--ink-soft); text-decoration: none; max-width: 46%; }
.pager a:hover { color: var(--accent); }
.pager .next { margin-left: auto; text-align: right; }
.back-to-play { margin: 24px 0 0; font-size: 15px; }

/* ---- index pages ---- */

.guide-index { padding-bottom: 48px; }
.guide-index h1 {
  font-size: clamp(28px, 4.6vw, 40px); letter-spacing: -.026em;
  margin: 18px 0 12px; font-weight: 660;
}
.tier-head {
  font-size: 15px; text-transform: uppercase; letter-spacing: .07em;
  margin: 34px 0 14px; font-weight: 620;
}
.tier-head.tier-easy { color: var(--tier-easy); }
.tier-head.tier-medium { color: var(--tier-medium); }
.tier-head.tier-hard { color: var(--tier-hard); }
.tier-head.tier-expert { color: var(--tier-expert); }
.tier-head.tier-extreme { color: var(--tier-extreme); }

.tech-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tech-card {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; text-decoration: none; display: block;
}
.tech-card:hover { border-color: var(--line-strong); }
.tech-card h3 {
  margin: 0 0 6px; font-size: 15.5px; color: var(--ink);
  display: flex; align-items: center; gap: 7px;
}
.tech-card p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.dot.live { background: var(--accent); }


/* ---- shaded-grid games (Hitori, Nurikabe, Battleship) ---- */

/* Hitori marks a cell with a circle over it, never a fill, so the number stays
   readable whether it is kept or rejected — the app's own convention. */
.diagram .ring { fill: none; stroke-width: 2.6; }
.diagram .ring.kept-ring     { stroke: var(--mark-keep); }
.diagram .ring.rejected-ring { stroke: var(--mark-drop); }

.diagram .cell.land   { fill: var(--bg-raised); }
.diagram .cell.sea    { fill: var(--line-strong); }
.diagram .cell.ship   { fill: color-mix(in srgb, var(--accent) 62%, var(--bg-raised)); }
.diagram .cell.water  { fill: color-mix(in srgb, var(--brand-indigo) 16%, var(--bg-sunken)); }

/* A number sitting on a shaded cell needs the inverse ink to stay legible. */
.diagram .given.on-dark { fill: var(--bg); }
.diagram .axis.strong { fill: var(--ink-soft); font-weight: 700; font-size: 12px; }
.diagram .clue-disc { fill: var(--bg-raised); stroke: var(--ink); stroke-width: 1.4; }
.diagram .clue-num {
  fill: var(--ink); font: 700 13px ui-sans-serif, system-ui, sans-serif;
  text-anchor: middle;
}

/* ---- Kakuro ---- */

.diagram .cell.block { fill: var(--line-strong); }
.diagram .rule.clue-slash { stroke: var(--bg); stroke-width: 1.2; }
.diagram .kclue {
  fill: var(--bg); font: 700 11px ui-sans-serif, system-ui, sans-serif;
  text-anchor: middle;
}

/* ---- Bridges ---- */

/* Bridges' grid. Same recipe as .rule above rather than the play board's
   --bridges-grid: a diagram sits on --bg-raised, the play board on --bg. */
.diagram .bgridline { stroke: color-mix(in srgb, var(--ink) 18%, transparent); stroke-width: 1; }
.diagram .bgridframe {
  fill: none; stroke: color-mix(in srgb, var(--ink) 28%, transparent); stroke-width: 1.4;
}

.diagram .island { fill: var(--bg-raised); stroke: var(--ink); stroke-width: 1.6; }
.diagram .island.f-pattern-stroke { stroke: var(--brand-amber); stroke-width: 2.6; }
.diagram .island-num {
  fill: var(--ink); font: 700 14px ui-sans-serif, system-ui, sans-serif;
  text-anchor: middle;
}
.diagram .span { stroke: var(--ink-soft); stroke-width: 2.2; }
.diagram .span.add { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 6 4; }
.diagram .span.limit { stroke: var(--brand-amber); stroke-width: 2.4; stroke-dasharray: 2 3; }
.diagram .span.deny { stroke: color-mix(in srgb, var(--danger) 55%, transparent); stroke-width: 1.6; stroke-dasharray: 3 4; }

/* ---- Slitherlink ---- */

.diagram .dot { fill: var(--ink-faint); }
.diagram .sl-clue {
  fill: var(--ink); font: 600 15px ui-sans-serif, system-ui, sans-serif;
  text-anchor: middle;
}
.diagram .sl-edge { stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; }
.diagram .sl-edge.place { stroke: var(--accent); stroke-width: 3.6; }
.diagram .sl-edge.pattern { stroke: var(--brand-amber); stroke-width: 3; }
.diagram .sl-x { stroke: var(--ink-faint); stroke-width: 1.5; stroke-linecap: round; }
.diagram .sl-sector {
  fill: var(--brand-indigo); font: 700 9px ui-sans-serif, system-ui, sans-serif;
  text-anchor: middle;
}

/* ---- legend swatches for the above ---- */

.swatch.land-swatch { background: var(--bg-raised); border-color: var(--line-strong); }
.swatch.sea-swatch { background: var(--line-strong); }
/* Hitori's two swatches are the circles themselves. */
.swatch.kept-swatch, .swatch.rejected-swatch {
  background: transparent; border-radius: 50%; border-width: 2px;
}
.swatch.kept-swatch     { border-color: var(--mark-keep); }
.swatch.rejected-swatch { border-color: var(--mark-drop); }
.swatch.ship-swatch { background: color-mix(in srgb, var(--accent) 62%, transparent); }
.swatch.water-swatch { background: color-mix(in srgb, var(--brand-indigo) 30%, transparent); }
.swatch.span-swatch { background: var(--ink-soft); }
.swatch.add-swatch { background: var(--accent); }
.swatch.deny-swatch { background: color-mix(in srgb, var(--danger) 55%, transparent); }
.swatch.on-swatch { background: var(--ink); }
.swatch.place-swatch { background: var(--accent); }
.swatch.x-swatch { background: var(--ink-faint); }
.swatch.sector-swatch { background: var(--brand-indigo); }

/* Role outlines. Drawn over the state fill so a sea cell can still show that
   it is also the pattern cell — a fill can only carry one of those meanings. */
.diagram .frame { fill: none; stroke-width: 2.6; }
.diagram .frame.pattern { stroke: var(--brand-amber); }
.diagram .frame.target { stroke: var(--accent); }
.swatch.frame-pattern { background: transparent; border: 2px solid var(--brand-amber); }
.swatch.frame-target { background: transparent; border: 2px solid var(--accent); }

/* ============================================================ polish pass
   Match the elevation and rounding the rest of the site gained. */

.tech-card {
  border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease),
              border-color .2s var(--ease);
}
.tech-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.tech-card h3 { letter-spacing: -.016em; }

.board-fig {
  border-radius: var(--radius-lg); padding: 26px;
  box-shadow: var(--shadow);
  background: linear-gradient(180deg,
    var(--bg-raised), color-mix(in srgb, var(--bg-sunken) 45%, var(--bg-raised)));
}

.badge { border-radius: 999px; padding: 5px 12px; font-size: 12.5px; }
.guide-head h1 { font-weight: 700; letter-spacing: -.032em; }
.guide .summary { font-size: 18.5px; line-height: 1.55; }
.steps li { margin-bottom: 14px; }

.tier-head {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; letter-spacing: .1em;
}
/* A rule trailing the tier label, so the groups read as bands. */
.tier-head::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to right,
    color-mix(in srgb, currentColor 40%, transparent), transparent);
}

.pager {
  border-top: 1px solid var(--line); padding-top: 24px;
}
.pager a {
  padding: 10px 14px; border-radius: 10px;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.pager a:hover { background: var(--bg-sunken); color: var(--accent); }

.crumb { padding-top: 28px; }

/* A game's technique index leads with the same icon its card uses, so the
   guides read as the same product as the boards. */
.guide-title {
  display: flex; align-items: center; gap: 18px; margin: 18px 0 12px;
  --hue: var(--accent);
}
.guide-title h1 { margin: 0; }
.guide-title .gicon { width: 58px; height: 58px; border-radius: 14px; }
.guide-title .gicon svg { width: 40px; height: 40px; }
@media (max-width: 520px) {
  .guide-title { gap: 13px; }
  .guide-title .gicon { width: 46px; height: 46px; border-radius: 12px; }
  .guide-title .gicon svg { width: 32px; height: 32px; }
}

/* The hub's card tag already reads "45 techniques · 31 live" — it is a count,
   not a call to action, so it gets neither the arrow nor a suffix. */
.game .tag.guide-tag::after { content: none; }
