/* Sudoku Án Mạng (site/pages/sudoku-an-mang.html).
   Look: 8-bit pixel art in the brand colours: black and charcoal with the site's yellow (#FFDA3D).
   Red is kept only for meaning (victim, killer, wrong placement). VT323 pixel type (has Vietnamese accents), square corners, 3px ink borders with
   hard offset shadows, a small fixed palette, and stepped (not smooth) animation.
   Sprites (furniture, portraits, ✕) are drawn in site/assets/scripts/sudoku.js. */

.sudoku-page {
  /* --ink: outlines, hard shadows and dark chips. --fg: text. --paper/--panel: dark surfaces. */
  --ink: #000000;
  --fg: #f5f2ea;
  --light: #f5f2ea;
  --paper: #161616;
  --panel: #202020;
  --panel-2: #2e2e2e;
  --muted: #a39e93;
  --line: rgba(255, 255, 255, 0.14);
  --red: #c8423a;
  --green: #4caf50;
  --yellow: #ffda3d;
  --blue: #ffda3d; /* focus rings use the brand yellow */
  --px: 3px;
  --pixel-font: "VT323", ui-monospace, "Courier New", monospace;
  background-color: #0a0a0a;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--fg);
  color-scheme: dark;
}

.sdk-main {
  --text: var(--ink);
  --text-muted: var(--muted);
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(var(--site-nav-height) + 2.5rem) 16px 4rem;
  font-family: var(--pixel-font);
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--fg);
}
.sdk-main [hidden] { display: none !important; }
/* site.css sets fonts on headings and buttons directly; use the pixel font for everything here. */
.sdk-main *, .sdk-modal * { font-family: var(--pixel-font) !important; }
.sdk-main button { font-family: var(--pixel-font); -webkit-tap-highlight-color: transparent; }
.sdk-main :focus-visible { outline: var(--px) dashed var(--blue); outline-offset: 3px; }
.sdk-main h1, .sdk-main h2, .sdk-main h3, .sdk-main h4, .sdk-main strong { font-weight: 400; }
.sdk-main svg { image-rendering: pixelated; }

/* The one recurring shape: a box with an ink border and a hard shadow. */
.sdk-rules, .sdk-card, .sdk-offer, .sdk-status, .sdk-person, .sdk-rail, .sdk-board, .sdk-modal-card,
.sdk-general, .sdk-tool, .sdk-submit, .sdk-pick, .sdk-filter, .sdk-sort select, .sdk-main .btn, .sdk-redeem input, .sdk-timer {
  border: var(--px) solid var(--ink);
  border-radius: 0;
}
.sdk-rules, .sdk-card, .sdk-offer, .sdk-status, .sdk-person, .sdk-rail, .sdk-board, .sdk-modal-card {
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
}

.sdk-eyebrow {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0 0.4rem;
  background: var(--ink);
  color: var(--yellow);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- home: hero ---------- */
.sdk-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: end;
  margin-bottom: 3.5rem;
}
.sdk-hero h1 {
  font-size: clamp(3.4rem, 9vw, 6rem);
  line-height: 0.85;
  margin: 0 0 1rem;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--yellow);
}
.sdk-h1-small { display: block; font-size: 0.45em; color: var(--yellow); text-shadow: none; margin-bottom: 0.3rem; }
.sdk-lead { max-width: 34em; font-size: 1.35rem; line-height: 1.3; color: var(--muted); margin: 0; }
.sdk-streak {
  display: inline-block;
  margin: 1rem 0 0;
  padding: 0.15rem 0.6rem;
  background: var(--ink);
  color: var(--yellow);
}
.sdk-streak::before { content: '★ '; }
.sdk-rules { padding: 1.2rem 1.3rem; }
.sdk-rules-title { margin: 0 0 0.6rem; font-size: 1.5rem; text-transform: uppercase; }
.sdk-rules ol { list-style: none; counter-reset: rule; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.sdk-rules li { counter-increment: rule; position: relative; padding-left: 2.1rem; line-height: 1.2; }
.sdk-rules li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.4rem;
  text-align: center;
  background: var(--ink);
  color: var(--yellow);
}
.sdk-rules-note { margin: 0.8rem 0 0; padding-top: 0.6rem; border-top: 2px dashed var(--line); font-size: 1.05rem; color: var(--muted); }

/* ---------- home: sections, cards ---------- */
.sdk-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.4rem;
  border-bottom: var(--px) solid var(--panel-2);
}
.sdk-section-head h2 { margin: 0; font-size: 2.2rem; line-height: 1; text-transform: uppercase; }
.sdk-date { color: var(--muted); }
.sdk-loading { color: var(--muted); margin: 0; }

.sdk-today { margin-bottom: 3.5rem; }
.sdk-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.sdk-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 210px;
  padding: 1.1rem 1.2rem 1rem;
  text-align: left;
  color: var(--fg);
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform 0.1s steps(2), box-shadow 0.1s steps(2);
}
.sdk-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.sdk-card:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.sdk-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.sdk-card-slot { background: var(--ink); color: var(--light); padding: 0 0.4rem; text-transform: uppercase; }
.sdk-mini { display: grid; grid-template-columns: repeat(var(--n), 6px); gap: 1px; padding: 2px; background: var(--ink); }
.sdk-mini i { width: 6px; height: 6px; background: #6b675f; }
.sdk-mini i:nth-child(5n + 2) { background: var(--yellow); }
.sdk-card-title { font-size: 1.75rem; line-height: 1.05; max-width: 20ch; }
.sdk-card-meta { display: flex; align-items: center; gap: 1rem; color: var(--muted); }
.sdk-card-cta {
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 2px dashed var(--line);
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
}
.sdk-card-cta::after { content: '▶'; }
.sdk-card.is-solved .sdk-card-cta { color: var(--muted); }
.sdk-card-stamp {
  position: absolute;
  right: 1rem;
  bottom: 3.4rem;
  padding: 0 0.4rem;
  background: var(--red);
  color: var(--light);
  text-transform: uppercase;
  transform: rotate(-6deg);
}

.sdk-size { color: var(--fg); }
.sdk-diff { display: inline-flex; align-items: center; gap: 0.4rem; }
.sdk-diff-bars { display: inline-flex; gap: 2px; align-items: flex-end; }
.sdk-diff-bars i { width: 5px; background: #3a3a3a; }
.sdk-diff-bars i:nth-child(1) { height: 4px; }
.sdk-diff-bars i:nth-child(2) { height: 7px; }
.sdk-diff-bars i:nth-child(3) { height: 11px; }
.sdk-diff-bars i:nth-child(4) { height: 14px; }
.sdk-diff-bars i:nth-child(5) { height: 17px; }
.sdk-diff-bars i:nth-child(6) { height: 19px; }
.sdk-diff-bars i.on { background: var(--yellow); }

/* sealed case: hazard tape that splits on open */
.sdk-tape {
  position: absolute;
  left: -10px;
  right: -10px;
  top: 60%;
  height: 26px;
  transform: rotate(-4deg);
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
  border-block: 2px solid var(--ink);
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 12px, var(--ink) 12px 24px);
  transition: transform 0.4s steps(4), opacity 0.4s steps(4);
}
.sdk-tape span {
  display: inline-block;
  margin: 1px 0 0 12%;
  padding: 0 0.4rem;
  background: var(--yellow);
  color: var(--fg);
  font-size: 1.05rem;
  line-height: 20px;
  text-transform: uppercase;
}
.sdk-tape--l { clip-path: polygon(0 0, 52% 0, 49% 50%, 53% 100%, 0 100%); }
.sdk-tape--r { clip-path: polygon(52% 0, 100% 0, 100% 100%, 53% 100%, 49% 50%); }
.sdk-card.is-opening .sdk-tape--l { transform: rotate(-12deg) translate(-40%, 26px); opacity: 0; }
.sdk-card.is-opening .sdk-tape--r { transform: rotate(4deg) translate(40%, -22px); opacity: 0; }
.sdk-card.is-opening { animation: sdk-open 0.72s steps(6) forwards; }
@keyframes sdk-open { 60% { transform: translate(-3px, -3px); } 100% { transform: translate(-3px, -3px); opacity: 0; } }

/* ---------- home: pass offer, archive ---------- */
.sdk-pass-badge { background: var(--green); color: var(--light); padding: 0 0.5rem; }
.sdk-offer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 2rem;
  align-items: center;
  padding: 1.3rem 1.4rem;
  margin-bottom: 1.8rem;
  background: var(--yellow);
}
.sdk-offer h3 { margin: 0 0 0.3rem; font-size: 1.9rem; line-height: 1; text-transform: uppercase; }
.sdk-offer p { margin: 0; max-width: 46ch; }
.sdk-offer-actions { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.sdk-redeem, .sdk-offer > .sdk-form-msg { grid-column: 1 / -1; }
.sdk-redeem { padding-top: 0.9rem; border-top: 2px dashed var(--line); }
.sdk-redeem label { display: block; margin-bottom: 0.4rem; }
.sdk-redeem-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.sdk-redeem input {
  flex: 1 1 220px;
  padding: 0.5rem 0.7rem;
  background: var(--paper);
  color: var(--fg);
  font: 1.3rem/1 var(--pixel-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sdk-redeem input:focus { outline: none; box-shadow: 3px 3px 0 var(--blue); }
.sdk-form-msg { min-height: 1.2em; margin: 0.4rem 0 0; }
.sdk-link {
  background: none;
  border: 0;
  padding: 0.2rem 0;
  color: inherit;
  font-size: 1.15rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* The site's .btn, redrawn as a pixel button on this page. */
.sdk-main .btn {
  display: inline-block;
  padding: 0.45rem 1.2rem;
  background: var(--paper);
  color: var(--fg);
  font: 1.35rem/1.1 var(--pixel-font);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
  transform: none;
  cursor: pointer;
}
.sdk-main .btn::before { display: none; }
.sdk-main .btn-primary { background: var(--ink); color: var(--yellow); }
.sdk-main .btn:hover { background: var(--yellow); color: var(--fg); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.sdk-main .btn:active { transform: translate(3px, 3px) !important; box-shadow: 1px 1px 0 var(--ink); }

.sdk-archive-tools { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.8rem 1.4rem; margin-bottom: 1rem; }
.sdk-progress { display: grid; gap: 0.3rem; min-width: 170px; }
.sdk-solved-count { margin: 0; color: var(--muted); }
.sdk-solved-count strong { font-size: 1.8rem; color: var(--fg); }
.sdk-solved-bar { --p: 0; position: relative; display: block; height: 10px; border: 2px solid var(--ink); background: var(--paper); }
.sdk-solved-bar::after { content: ''; position: absolute; inset: 0; background: var(--yellow); transform-origin: left; transform: scaleX(var(--p)); }
.sdk-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.sdk-filter { padding: 0.1rem 0.6rem; background: var(--paper); color: var(--fg); font-size: 1.2rem; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.sdk-filter:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.sdk-filter.is-on { background: var(--ink); color: var(--yellow); }
.sdk-filter-count { margin-left: 0.3rem; opacity: 0.7; }
.sdk-sort { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--muted); }
.sdk-sort select { padding: 0.15rem 0.4rem; background: var(--paper); color: var(--fg); font: 1.2rem var(--pixel-font); cursor: pointer; }

.sdk-archive-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
.sdk-archive-item { border-bottom: 2px dashed var(--line); animation: sdk-item-in 0.3s steps(3) both; animation-delay: calc(var(--i, 0) * 25ms); }
@keyframes sdk-item-in { from { opacity: 0; transform: translateY(6px); } }
.sdk-archive-btn {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: 'date title state' 'date meta state';
  column-gap: 0.9rem;
  align-items: center;
  padding: 0.6rem 0.4rem;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 1.2rem;
  text-align: left;
  cursor: pointer;
}
.sdk-archive-btn:hover { background: var(--paper); }
.sdk-archive-date { grid-area: date; align-self: start; padding: 0 0.3rem; background: var(--ink); color: var(--light); white-space: nowrap; }
.sdk-archive-title { grid-area: title; font-size: 1.35rem; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdk-archive-meta { grid-area: meta; display: flex; gap: 0.8rem; align-items: center; color: var(--muted); font-size: 1.1rem; }
.sdk-archive-state { grid-area: state; text-transform: uppercase; color: var(--muted); }
.sdk-archive-state::after { content: ' ▶'; }
.sdk-archive-item.is-solved .sdk-archive-state { color: var(--red); }
.sdk-archive-item.is-solved .sdk-archive-state::after { content: ' ✓'; }
.sdk-archive-item.is-locked .sdk-archive-title, .sdk-archive-item.is-locked .sdk-archive-meta { opacity: 0.5; }
.sdk-archive-item.is-locked .sdk-archive-state::after { content: ' ■'; }

/* ---------- game: top bar ---------- */
.sdk-game { margin-inline: calc((100% - min(1320px, 100vw - 32px)) / 2); }
.sdk-game-bar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.sdk-back {
  flex: 0 0 auto;
  padding: 0.25rem 0.7rem;
  border: var(--px) solid var(--ink);
  background: var(--paper);
  color: var(--fg);
  font-size: 1.15rem;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
.sdk-back:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.sdk-game-titles { min-width: 0; flex: 1; }
.sdk-game-titles h2 { margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1; }
.sdk-game-meta { margin: 0.15rem 0 0; color: var(--muted); font-size: 1.15rem; }
.sdk-timer {
  flex: 0 0 auto;
  min-width: 5.2rem;
  padding: 0.05rem 0.6rem;
  background: var(--ink);
  color: var(--yellow);
  font-size: 2rem;
  line-height: 1.1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 3px 3px 0 rgba(26, 28, 44, 0.35);
}

/* ---------- game: three columns (suspects | board | tools) ---------- */
.sdk-play {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) minmax(0, min(560px, calc(100vh - 250px))) 180px;
  grid-template-columns: minmax(330px, 1fr) minmax(0, min(560px, calc(100dvh - 250px))) 180px;
  grid-template-areas: 'suspects board rail';
  gap: 1.5rem;
  align-items: start;
}
.sdk-suspects-col { grid-area: suspects; min-width: 0; }
.sdk-board-col { grid-area: board; min-width: 0; position: sticky; top: calc(var(--site-nav-height) + 1rem); }
.sdk-rail { grid-area: rail; position: sticky; top: calc(var(--site-nav-height) + 1rem); }
.sdk-col-title { margin: 0; font-size: 1.6rem; line-height: 1; text-transform: uppercase; }
.sdk-col-sub { margin: 0.1rem 0 0.8rem; color: var(--muted); font-size: 1.05rem; }

/* suspect cards: portrait on top, name banner, their clue below */
.sdk-suspects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; align-items: stretch; }
.sdk-person { display: flex; flex-direction: column; box-shadow: 4px 4px 0 var(--ink); transition: transform 0.1s steps(2); }
.sdk-person-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: var(--px) solid var(--ink);
  background: var(--pc-light, var(--panel));
  color: var(--fg);
  text-align: center;
  cursor: pointer;
}
.sdk-person .sdk-token {
  display: block;
  width: 64%;
  max-width: 84px;
  margin: 0.5rem auto 0.3rem;
  aspect-ratio: 1;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.sdk-person-text { display: grid; padding: 0.2rem 0.3rem 0.3rem; background: var(--paper); border-top: var(--px) solid var(--ink); }
.sdk-person-text strong { font-size: 1.45rem; line-height: 1; }
.sdk-person-text small { font-size: 0.95rem; line-height: 1.1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdk-person .sdk-clues { flex: 1; list-style: none; margin: 0; padding: 0.45rem 0.5rem 0.55rem; background: var(--paper); }
.sdk-person .sdk-clues li { display: block; }
.sdk-person.is-selected { transform: translate(-3px, -3px); box-shadow: 7px 7px 0 var(--ink); }
.sdk-person.is-selected .sdk-person-text { background: var(--yellow); }
.sdk-person.is-selected .sdk-person-text strong::before { content: '▶ '; }
.sdk-person.is-placed .sdk-person-head .sdk-token { filter: grayscale(0.7); opacity: 0.6; }
.sdk-person.is-victim .sdk-person-head { background: #f1c6cd; }
.sdk-person.is-victim .sdk-person-text { background: var(--red); color: var(--light); }
.sdk-person.is-victim .sdk-person-text small { color: #ffe3e8; }

.sdk-clue {
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  font-size: 1.2rem;
  line-height: 1.1;
  text-align: left;
  cursor: pointer;
}
.sdk-rule { font-size: 1.15rem; line-height: 1.1; color: var(--red); }
.sdk-general { margin-top: 0.9rem; padding: 0.5rem 0.6rem; background: var(--paper); border-style: dashed; }
.sdk-general h4 { margin: 0 0 0.3rem; font-size: 1.1rem; text-transform: uppercase; color: var(--muted); }
.sdk-general .sdk-clues { list-style: none; margin: 0; padding: 0; }

/* placed: green tick on the portrait */
.sdk-token.is-done::before {
  content: '✓';
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  background: var(--green);
  color: var(--light);
  border: 2px solid var(--ink);
  font: 1rem/16px var(--pixel-font);
  text-align: center;
}
.sdk-person .sdk-token.is-done { position: relative; }

/* status above the board */
.sdk-status { display: flex; align-items: center; gap: 0.7rem; min-height: 60px; padding: 0.4rem 0.7rem; margin-bottom: 0.9rem; box-shadow: 4px 4px 0 var(--ink); }
.sdk-status.is-mark { background: var(--panel-2); }
.sdk-status-who { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; }
.sdk-status-who:empty { display: none; }
.sdk-status-who .sdk-token { width: 44px; max-width: none; }
.sdk-status-who .sdk-mark { width: 60%; }
.sdk-status-text { display: grid; min-width: 0; }
.sdk-status-text strong { font-size: 1.35rem; line-height: 1.05; }
.sdk-status-text span { font-size: 1.1rem; line-height: 1.1; color: var(--muted); }

/* ---------- the board ---------- */
.sdk-board { display: grid; padding: 0; border-width: 4px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 6px 6px 0 var(--ink); }
.sdk-row { display: grid; grid-template-columns: repeat(var(--n), 1fr); }
.sdk-cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(26, 28, 44, 0.16);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
.sdk-cell.wall-t { border-top: 4px solid var(--ink); }
.sdk-cell.wall-b { border-bottom: 4px solid var(--ink); }
.sdk-cell.wall-l { border-left: 4px solid var(--ink); }
.sdk-cell.wall-r { border-right: 4px solid var(--ink); }
.sdk-row:first-child .sdk-cell { border-top-width: 0; }
.sdk-row:last-child .sdk-cell { border-bottom-width: 0; }
.sdk-row .sdk-cell:first-child { border-left-width: 0; }
.sdk-row .sdk-cell:last-child { border-right-width: 0; }
.sdk-cell:hover:not(.is-blocked) { box-shadow: inset 0 0 0 3px rgba(26, 28, 44, 0.35); }
.sdk-cell:focus-visible { outline: 3px dashed var(--blue); outline-offset: -5px; z-index: 6; }
.sdk-cell.is-blocked { cursor: not-allowed; }
.sdk-cell.is-ruled-out { cursor: default; }

/* pixel floors */
.sdk-cell.floor-tiles { background-image: repeating-conic-gradient(rgba(26, 28, 44, 0.07) 0 25%, transparent 0 50%); background-size: 50% 50%; }
.sdk-cell.floor-planks { background-image: repeating-linear-gradient(0deg, transparent 0 calc(25% - 2px), rgba(26, 28, 44, 0.09) calc(25% - 2px) 25%); }

.sdk-room-label {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  padding: 0 4px;
  background: var(--ink);
  color: var(--light);
  font-size: clamp(0.8rem, 1.9vw, 1.05rem);
  line-height: 1.2;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 1;
}
.sdk-room-label::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 4px; vertical-align: 1px; background: var(--room-ink, var(--paper)); box-shadow: 0 0 0 1px var(--light); }

.sdk-feature { display: block; width: 84%; height: 84%; pointer-events: none; position: relative; z-index: 0; }
.sdk-feature svg { width: 100%; height: 100%; display: block; }
.sdk-cell.f-C .sdk-feature, .sdk-cell.f-R .sdk-feature { position: absolute; inset: 8%; width: auto; height: auto; }

/* people on the board: portrait in a frame, initial in the corner */
.sdk-token {
  position: relative;
  z-index: 2;
  display: block;
  width: 70%;
  max-width: 64px;
  aspect-ratio: 1;
  background: var(--pc-light, var(--panel));
  border: var(--px) solid var(--ink);
  box-shadow: 3px 3px 0 rgba(26, 28, 44, 0.45);
}
.sdk-token svg { width: 100%; height: 100%; display: block; }
.sdk-token-tag {
  position: absolute;
  right: -5px;
  bottom: -6px;
  min-width: 16px;
  padding: 0 2px;
  background: var(--pc, var(--ink));
  color: var(--light);
  border: 2px solid var(--ink);
  font: 400 0.95rem/13px var(--pixel-font);
  text-align: center;
}
.sdk-token.is-victim { background: #f1c6cd; border-color: var(--red); }
.sdk-cell.f-C .sdk-token { width: 56%; transform: translateY(-6%); }
.sdk-token.is-selected { box-shadow: 0 0 0 3px var(--yellow), 0 0 0 6px var(--ink); animation: sdk-float 1.6s ease-in-out infinite; }
@keyframes sdk-float { 50% { transform: translateY(-3px); } }
.sdk-token.is-bad { box-shadow: 0 0 0 3px var(--red); }
.sdk-token.is-new { animation: sdk-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* marks and notes */
.sdk-mark { display: block; width: 42%; aspect-ratio: 1; pointer-events: none; position: relative; z-index: 2; }
.sdk-mark svg { width: 100%; height: 100%; display: block; }
.sdk-mark.is-auto { width: 30%; }
.sdk-mark.is-fresh { animation: sdk-mark-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: var(--d, 0ms); }
@keyframes sdk-mark-in { from { opacity: 0; transform: scale(0.3); } }
.sdk-notes { position: absolute; left: 3px; right: 3px; bottom: 3px; display: flex; flex-wrap: wrap; gap: 2px; pointer-events: none; z-index: 3; }
.sdk-notes i {
  min-width: 14px;
  padding: 0 2px;
  background: var(--pc-light, var(--paper));
  color: var(--pc-dark, var(--ink));
  border: 2px solid var(--pc-dark, var(--ink));
  font: 400 0.9rem/12px var(--pixel-font);
  font-style: normal;
  text-align: center;
}

/* press-and-hold progress: a pixel bar along the bottom */
.sdk-cell.is-holding::before {
  content: '';
  position: absolute;
  left: 6%;
  bottom: 6%;
  height: 6px;
  width: 88%;
  background: var(--ink);
  transform-origin: left;
  z-index: 4;
  animation: sdk-hold 0.42s steps(6) forwards;
}
@keyframes sdk-hold { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* clashes, crime scene, hints */
.sdk-cell.is-clash::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(45deg, rgba(177, 62, 83, 0.25) 0 4px, transparent 4px 8px); }
.sdk-board.is-solved .sdk-cell:not(.is-crime) { filter: grayscale(0.8); opacity: 0.55; }
.sdk-cell.is-crime { box-shadow: inset 0 0 0 999px rgba(177, 62, 83, 0.22); }
.sdk-token.is-dim { opacity: 0.35; filter: grayscale(1); }
.sdk-token.is-killer { border-color: var(--red); animation: sdk-killer 0.6s steps(2) 4; }
@keyframes sdk-killer { 50% { box-shadow: 0 0 0 4px var(--red); } }
.sdk-token.is-hint { animation: sdk-hintblink 0.5s steps(2) 4; }
@keyframes sdk-hintblink { 50% { box-shadow: 0 0 0 4px var(--green); } }
.sdk-token.is-hint-wrong { animation: sdk-wrong 0.3s steps(2) 4; box-shadow: 0 0 0 3px var(--red); }
@keyframes sdk-wrong { 50% { transform: translateX(4px); } }

/* people strip under the board (narrow screens only) */
.sdk-picker { display: none; gap: 0.5rem; overflow-x: auto; padding: 0.9rem 4px 0.4rem; scrollbar-width: none; }
.sdk-picker::-webkit-scrollbar { display: none; }
.sdk-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  padding: 0.15rem 0.5rem 0.15rem 0.15rem;
  background: var(--paper);
  color: var(--fg);
  font-size: 1.2rem;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
.sdk-pick .sdk-token { width: 30px; border-width: 2px; box-shadow: none; }
.sdk-pick.is-placed { opacity: 0.55; }
.sdk-pick.is-selected { opacity: 1; background: var(--yellow); }

/* ---------- tools column ---------- */
.sdk-rail { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.8rem; }
.sdk-rail .sdk-col-title { margin-bottom: 0.2rem; }
.sdk-tool {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: var(--paper);
  color: var(--fg);
  font-size: 1.25rem;
  line-height: 1;
  text-align: left;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
.sdk-tool:hover:not([disabled]) { background: var(--panel); }
.sdk-tool:active:not([disabled]) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.sdk-tool[disabled] { opacity: 0.4; cursor: not-allowed; }
.sdk-tool-icon { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; flex: 0 0 1.6rem; background: var(--ink); color: var(--light); font-size: 1.1rem; }
.sdk-tool small { display: block; font-size: 0.9rem; color: var(--muted); }
.sdk-tool--big { padding: 0.6rem 0.5rem; font-size: 1.4rem; }
.sdk-tool.is-on { background: var(--ink); color: var(--yellow); }
.sdk-tool.is-on .sdk-tool-icon { background: var(--yellow); color: var(--fg); }
.sdk-tool--hold { overflow: hidden; }
.sdk-tool--hold::after { content: ''; position: absolute; inset: 0; background: rgba(177, 62, 83, 0.3); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.sdk-tool--hold.is-holding::after { transform: scaleX(1); transition: transform 0.9s steps(9); }
.sdk-rail-end { margin-top: 0.6rem; padding-top: 0.8rem; border-top: 2px dashed var(--line); }
.sdk-submit {
  width: 100%;
  padding: 0.7rem 0.4rem;
  background: var(--yellow);
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
}
.sdk-submit:hover:not([disabled]) { background: #ffe56e; }
.sdk-submit:active:not([disabled]) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.sdk-submit[disabled] { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }
.sdk-rail .sdk-form-msg { font-size: 1.05rem; line-height: 1.1; }

/* ---------- result ---------- */
.sdk-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(26, 28, 44, 0.7);
  animation: sdk-fade 0.2s steps(2);
}
.sdk-modal-card { position: relative; width: 100%; max-width: 460px; padding: 1.6rem 1.5rem 1.4rem; text-align: center; font-family: var(--pixel-font); font-size: 1.3rem; box-shadow: 8px 8px 0 var(--ink); animation: sdk-pop 0.3s steps(3); }
.sdk-modal-card h2 { margin: 0 0 0.5rem; font-size: 2.4rem; line-height: 1; }
.sdk-modal-card p { line-height: 1.2; }
.sdk-modal-card .sdk-eyebrow { background: var(--red); color: var(--light); }
.sdk-stamp { display: inline-block; margin-bottom: 0.8rem; padding: 0 0.5rem; background: var(--green); color: var(--light); font-size: 1.2rem; text-transform: uppercase; }
.sdk-modal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin-top: 1.2rem; }
@keyframes sdk-fade { from { opacity: 0; } }
@keyframes sdk-pop { from { transform: scale(0.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .sdk-main *, .sdk-modal, .sdk-modal * { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */
/* Tablet: board and tools side by side, suspects below. */
@media (max-width: 1100px) {
  .sdk-play {
    grid-template-columns: minmax(0, min(560px, calc(100vh - 250px))) 180px;
    grid-template-areas: 'board rail' 'suspects suspects';
    justify-content: center;
  }
  .sdk-board-col, .sdk-rail { position: static; }
}
@media (max-width: 900px) {
  .sdk-hero { grid-template-columns: 1fr; }
  .sdk-offer { grid-template-columns: 1fr; }
  .sdk-offer-actions { align-items: flex-start; }
  .sdk-archive-list { grid-template-columns: 1fr; }
  .sdk-archive-tools { grid-template-columns: 1fr auto; }
  .sdk-filters { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}
/* Phone: board, people strip, tools in a 2×2 grid, submit, then suspect cards. */
@media (max-width: 720px) {
  .sdk-play { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'board' 'rail' 'suspects'; gap: 1.1rem; }
  .sdk-picker { display: flex; }
  .sdk-rail { display: grid; grid-template-columns: 1fr 1fr; padding: 0.6rem; gap: 0.5rem; }
  .sdk-rail .sdk-col-title { display: none; }
  .sdk-rail-end { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
  .sdk-tool, .sdk-tool--big { font-size: 1.15rem; padding: 0.4rem; }
  .sdk-suspects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sdk-game-bar { flex-wrap: wrap; }
  .sdk-game-titles { order: 3; flex-basis: 100%; }
  .sdk-timer { margin-left: auto; }
}
@media (max-width: 520px) {
  .sdk-main { padding-top: calc(var(--site-nav-height) + 1.5rem); }
  .sdk-card { padding: 1rem; min-height: 0; }
  .sdk-board { border-width: 3px; box-shadow: 4px 4px 0 var(--ink); }
  .sdk-cell.wall-t { border-top-width: 3px; }
  .sdk-cell.wall-b { border-bottom-width: 3px; }
  .sdk-cell.wall-l { border-left-width: 3px; }
  .sdk-cell.wall-r { border-right-width: 3px; }
  .sdk-room-label { font-size: 0.8rem; padding: 0 3px; }
  .sdk-room-label::before { width: 5px; height: 5px; margin-right: 3px; }
  .sdk-token-tag { font-size: 0.8rem; line-height: 11px; min-width: 13px; }
  .sdk-archive-title { white-space: normal; }
  .sdk-sort span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* ---------- subtle motion ---------- */
.sdk-card, .sdk-person, .sdk-tool, .sdk-pick, .sdk-filter, .sdk-back, .sdk-submit, .sdk-main .btn {
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, opacity 0.2s ease;
}
.sdk-cell { transition: box-shadow 0.15s ease; }
.sdk-person:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.sdk-person.is-selected { animation: sdk-card-float 2s ease-in-out 0.25s infinite; }
@keyframes sdk-card-float { 0%, 100% { transform: translate(-3px, -3px); } 50% { transform: translate(-3px, -6px); } }
.sdk-person .sdk-token, .sdk-person-head { transition: filter 0.3s ease, opacity 0.3s ease, background-color 0.2s ease; }
.sdk-notes i.is-fresh { animation: sdk-mark-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1); }
.sdk-status.is-changed .sdk-status-text, .sdk-status.is-changed .sdk-status-who { animation: sdk-status-in 0.25s ease; }
@keyframes sdk-status-in { from { opacity: 0; transform: translateY(4px); } }
.sdk-submit.is-ready { animation: sdk-ready 1.8s ease-in-out infinite; }
@keyframes sdk-ready { 0%, 100% { box-shadow: 4px 4px 0 var(--ink); } 50% { box-shadow: 4px 4px 0 var(--ink), 0 0 0 5px rgba(255, 218, 61, 0.28); } }
.sdk-pick.is-selected { transform: translateY(-2px); }
.sdk-suspects.is-entering .sdk-person { animation: sdk-rise 0.4s ease both; }
.sdk-suspects.is-entering .sdk-person:nth-child(2) { animation-delay: 0.04s; }
.sdk-suspects.is-entering .sdk-person:nth-child(3) { animation-delay: 0.08s; }
.sdk-suspects.is-entering .sdk-person:nth-child(4) { animation-delay: 0.12s; }
.sdk-suspects.is-entering .sdk-person:nth-child(5) { animation-delay: 0.16s; }
.sdk-suspects.is-entering .sdk-person:nth-child(n+6) { animation-delay: 0.2s; }
@keyframes sdk-rise { from { opacity: 0; transform: translateY(8px); } }
.sdk-board.is-revealing .sdk-cell { animation: sdk-cell-in 0.35s ease both; animation-delay: var(--d, 0ms); }
@keyframes sdk-cell-in { from { opacity: 0; transform: scale(0.92); } }

@media (prefers-reduced-motion: reduce) {
  .sdk-main *, .sdk-modal, .sdk-modal * { animation: none !important; transition: none !important; }
}

/* ---------- phones ---------- */
.sdk-main button, .sdk-cell { touch-action: manipulation; }
@media (max-width: 720px) {
  .sdk-main { padding-left: 12px; padding-right: 12px; padding-bottom: calc(3rem + env(safe-area-inset-bottom)); }
  .sdk-game { margin-inline: 0; }
  .sdk-back { min-height: 40px; }
  .sdk-timer { font-size: 1.7rem; }
  .sdk-status { min-height: 64px; padding: 0.35rem 0.55rem; }
  .sdk-status-text strong { font-size: 1.25rem; }
  .sdk-status-text span { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sdk-status-text strong { line-height: 1; }
  .sdk-picker { padding-top: 0.6rem; }
  .sdk-play { gap: 0.8rem; }
  .sdk-tool, .sdk-tool--big { min-height: 46px; }
  .sdk-submit { min-height: 54px; font-size: 1.5rem; }
  .sdk-pick { min-height: 44px; font-size: 1.25rem; }
  .sdk-pick .sdk-token { width: 34px; }
  .sdk-person .sdk-token { width: 52%; margin-top: 0.4rem; }
  .sdk-person-text strong { font-size: 1.35rem; }
  .sdk-clue, .sdk-rule { font-size: 1.15rem; }
  .sdk-col-sub { display: none; }
  /* tools: one compact row of four, submit underneath */
  .sdk-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; padding: 0.5rem; }
  .sdk-rail .sdk-tool { flex-direction: column; justify-content: center; gap: 0.15rem; padding: 0.35rem 0.1rem; min-height: 58px; font-size: 1.05rem; text-align: center; }
  .sdk-rail .sdk-tool small { display: none; }
  .sdk-rail-end { grid-column: 1 / -1; }
  .sdk-game-meta { font-size: 1rem; }
  .sdk-main { padding-top: calc(var(--site-nav-height) + 1rem); }
}

/* ---------- game: everything on one screen, no scrolling ---------- */
body.sdk-in-game .sdk-main { padding-top: calc(var(--site-nav-height) + 1rem); padding-bottom: 1rem; }
.sdk-game-bar { margin-bottom: 0.9rem; }
.sdk-board-col .sdk-status { margin: 0.8rem 0 0; }
.sdk-board { margin-inline: auto; }

/* Desktop: board column sized to the window height (board + detail bar). */
.sdk-play {
  grid-template-columns: minmax(330px, 1fr) minmax(0, min(560px, calc(100vh - 290px))) 180px;
  grid-template-columns: minmax(330px, 1fr) minmax(0, min(560px, calc(100dvh - 290px))) 180px;
}
@media (min-width: 1101px) { .sdk-picker { display: none !important; } }

/* Tablet and phone: no big suspect cards; pick people from the strip under the board. */
@media (max-width: 1100px) {
  .sdk-suspects-col { display: none; }
  .sdk-picker { display: flex; }
  .sdk-play {
    grid-template-columns: minmax(0, min(560px, calc(100vh - 300px))) 180px;
    grid-template-columns: minmax(0, min(560px, calc(100dvh - 300px))) 180px;
    grid-template-areas: 'board rail';
    justify-content: center;
  }
}

/* Phone: one column that fits the screen: bar, board, people, detail, tools, submit. */
@media (max-width: 720px) {
  body.sdk-in-game .sdk-main { padding-top: calc(var(--site-nav-height) + 0.6rem); padding-bottom: calc(0.6rem + env(safe-area-inset-bottom)); }
  .sdk-play { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'board' 'rail'; gap: 0.6rem; }
  .sdk-game-bar { flex-wrap: nowrap; gap: 0.6rem; margin-bottom: 0.6rem; }
  .sdk-back { min-height: 40px; padding: 0 0.7rem; }
  .sdk-back-text { display: none; }
  .sdk-game-titles { order: 0; flex-basis: auto; }
  .sdk-game-titles h2 { font-size: 1.45rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sdk-game-meta { display: none; }
  .sdk-timer { font-size: 1.5rem; min-width: 4.4rem; margin-left: 0; }
  /* Board: as wide as the screen, but never so tall that the rest falls below the fold. */
  .sdk-board { width: min(100%, calc(100vh - 400px)); width: min(100%, calc(100svh - 400px)); }
  .sdk-picker { padding: 0.55rem 4px 0.15rem; }
  .sdk-board-col .sdk-status { margin-top: 0.55rem; min-height: 0; padding: 0.3rem 0.5rem; box-shadow: 3px 3px 0 var(--ink); }
  .sdk-status-who { width: 36px; height: 36px; flex-basis: 36px; }
  .sdk-status-who .sdk-token { width: 36px; }
  .sdk-status-text strong { font-size: 1.2rem; }
  .sdk-status-text span { font-size: 1rem; }
  .sdk-rail { box-shadow: none; border: 0; background: transparent; padding: 0; gap: 0.45rem; }
  .sdk-rail .sdk-tool { min-height: 52px; }
  .sdk-rail-end { margin: 0; padding: 0; border: 0; }
  .sdk-submit { min-height: 50px; }
  .sdk-rail .sdk-form-msg:empty { display: none; }
}

/* ---------- dark mode: dark text wherever the background is light (yellow, floors, portraits) ---------- */
.sdk-main .btn:hover, .sdk-tool.is-on .sdk-tool-icon, .sdk-offer, .sdk-tape span,
.sdk-person.is-selected .sdk-person-text, .sdk-pick.is-selected, .sdk-cell, .sdk-person-head { color: var(--ink); }
.sdk-person.is-selected .sdk-person-text small { color: #4a4433; }
.sdk-offer .sdk-redeem input { color: var(--fg); }
.sdk-offer .btn:not(.btn-primary) { color: var(--fg); }
.sdk-section-head { border-bottom-color: var(--panel-2); }
.sdk-hero h1 { color: var(--fg); text-shadow: 4px 4px 0 var(--yellow); }
.sdk-timer { box-shadow: 3px 3px 0 #000; border-color: #333; }
.sdk-board { border-color: #000; box-shadow: 6px 6px 0 #000; }
/* panels: black outline plus a faint inner edge, the classic dark 8-bit window */
.sdk-rules, .sdk-card, .sdk-offer, .sdk-status, .sdk-person, .sdk-rail, .sdk-modal-card {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 5px 5px 0 #000;
}
.sdk-person.is-selected { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 7px 7px 0 #000; }
.sdk-tool, .sdk-pick, .sdk-filter, .sdk-back, .sdk-main .btn, .sdk-submit { box-shadow: 3px 3px 0 #000; }
.sdk-archive-btn:hover { background: var(--panel); }
.sdk-modal { background: rgba(5, 6, 12, 0.78); }
.sdk-general { border-color: var(--panel-2); }
.sdk-person-text { color: var(--fg); }
.sdk-person.is-selected .sdk-person-text { color: var(--ink); }

/* ---------- moving ASCII background (canvas drawn by sudoku.js) ---------- */
.sudoku-page { background-image: none; background-color: #0a0a0a; }
.sdk-ascii { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.sdk-main { position: relative; z-index: 1; }
/* Text that sits straight on the background gets a soft black glow so it stays readable. */
.sdk-hero-text, .sdk-section-head, .sdk-game-titles, .sdk-archive-tools, .sdk-archive-list, .sdk-col-title, .sdk-col-sub {
  text-shadow: 0 0 4px #0a0a0a, 0 0 10px #0a0a0a, 0 0 18px #0a0a0a;
}
.sdk-hero h1 { text-shadow: 4px 4px 0 var(--yellow), 0 0 18px #0a0a0a; }

/* ---------- 8-bit navbar (this page only; the rest of the site keeps its own) ---------- */
.sudoku-page { --site-nav-height: 74px; }
.sudoku-page .site-nav {
  padding: 0.7rem 1.25rem 0.75rem;
  background: #0a0a0a;
  border-bottom: 3px solid #000;
  box-shadow: 0 3px 0 var(--yellow);
}
.sudoku-page .nav-links { gap: 0.6rem; }
.sudoku-page .nav-links a,
.sudoku-page .nav-logo {
  height: 2.4rem;
  padding: 0 0.6rem;
  border: 3px solid #000;
  border-radius: 0;
  background: #161616;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 3px 3px 0 #000;
  color: var(--yellow);
  font-family: var(--pixel-font) !important;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.sudoku-page .nav-links a:hover,
.sudoku-page .nav-logo:hover {
  background: #202020;
  color: var(--yellow);
  border-color: #000;
  transform: translate(-1px, -1px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 4px 4px 0 #000;
}
.sudoku-page .nav-links a:active,
.sudoku-page .nav-logo:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.sudoku-page .nav-links a.nav-active { background: var(--yellow); color: #000; }
.sudoku-page .nav-links a.nav-active::before { content: '▶ '; }
.sudoku-page .nav-links a.nav-cta-link { background: var(--yellow); color: #000; border-color: #000; }
.sudoku-page .nav-links a.nav-cta-link:hover { background: #ffe56e; color: #000; }

@media (max-width: 600px) {
  .sudoku-page { --site-nav-height: 52px; }
  .sudoku-page .site-nav { padding: 0.45rem 0.5rem 0.5rem; }
  .sudoku-page .nav-links { gap: 0.3rem; }
  .sudoku-page .nav-links a,
  .sudoku-page .nav-logo { height: 1.9rem; padding: 0 0.1rem; border-width: 2px; font-size: 0.82rem; letter-spacing: 0; box-shadow: 2px 2px 0 #000; }
  .sudoku-page .nav-links a.nav-active::before { content: ''; }
}

/* ---------- board in dark mode: dark floors, light stone walls ---------- */
.sudoku-page { --wall: #d8d0bc; }
.sdk-board { border-color: var(--wall); background: var(--wall); box-shadow: 0 0 0 3px #000, 6px 6px 0 3px #000; }
.sdk-cell { border-color: rgba(255, 255, 255, 0.07); }
.sdk-cell.wall-t { border-top-color: var(--wall); }
.sdk-cell.wall-b { border-bottom-color: var(--wall); }
.sdk-cell.wall-l { border-left-color: var(--wall); }
.sdk-cell.wall-r { border-right-color: var(--wall); }
.sdk-cell.floor-tiles { background-image: repeating-conic-gradient(rgba(255, 255, 255, 0.045) 0 25%, transparent 0 50%); }
.sdk-cell.floor-planks { background-image: repeating-linear-gradient(0deg, transparent 0 calc(25% - 2px), rgba(0, 0, 0, 0.22) calc(25% - 2px) 25%); }
.sdk-cell:hover:not(.is-blocked) { box-shadow: inset 0 0 0 3px rgba(255, 218, 61, 0.55); }
.sdk-cell.is-holding::before { background: var(--yellow); }
.sdk-cell.is-clash::after { background: repeating-linear-gradient(45deg, rgba(232, 80, 70, 0.32) 0 4px, transparent 4px 8px); }
.sdk-cell.is-crime { box-shadow: inset 0 0 0 999px rgba(232, 80, 70, 0.28); }
.sdk-room-label { background: #000; color: #f5f2ea; box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5); }
.sdk-token { border-color: #000; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6); }
.sdk-feature svg { filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.45)); }

/* ---------- desktop: give the board the screen ----------
   The whole game is one grid: the left column holds the title bar, detail bar and suspects; the
   board takes the full height under the navbar; tools on the right. */
.sdk-legend { display: none; }
@media (min-width: 1101px) {
  .sudoku-page { --site-nav-height: 66px; }
  body.sdk-in-game .sdk-main { padding-top: calc(var(--site-nav-height) + 0.8rem); padding-bottom: 0.8rem; }
  .sdk-game {
    --board: min(calc(100vh - var(--site-nav-height) - 1.6rem), calc(100vw - 32px - 380px - 190px - 2.8rem), 1400px);
    --board: min(calc(100dvh - var(--site-nav-height) - 1.6rem), calc(100vw - 32px - 380px - 190px - 2.8rem), 1400px);
    /* Use the whole window width (the page container is narrower). */
    margin-inline: calc((100% - (100vw - 32px)) / 2);
    display: grid;
    grid-template-columns: minmax(380px, 1fr) var(--board) 190px;
    grid-template-rows: auto auto 1fr;
    grid-template-areas: 'bar board rail' 'status board rail' 'suspects board rail';
    gap: 0.8rem 1.4rem;
    height: var(--board);
  }
  .sdk-play, .sdk-board-col { display: contents; }
  .sdk-game-bar { grid-area: bar; margin: 0; gap: 0.4rem 0.7rem; flex-wrap: wrap; align-items: center; }
  .sdk-game-bar .sdk-timer { margin-left: auto; }
  .sdk-game-bar .sdk-game-titles { order: 3; flex-basis: 100%; }
  .sdk-game-titles h2 { font-size: 1.7rem; line-height: 1; }
  .sdk-game-meta { font-size: 1.05rem; }
  .sdk-board { grid-area: board; width: var(--board); align-self: start; }
  .sdk-board-col .sdk-status { grid-area: status; margin: 0; }
  .sdk-rail { grid-area: rail; position: static; align-self: stretch; }
  .sdk-board-col { position: static; }

  /* Suspects fill the rest of the left column, down to the board's bottom edge. */
  .sdk-suspects-col { grid-area: suspects; position: static; display: flex; flex-direction: column; min-height: 0; align-self: stretch; }
  .sdk-col-sub { display: none; }
  .sdk-suspects-col .sdk-col-title { font-size: 1.3rem; margin-bottom: 0.5rem; }
  /* Two cards per row, more when the column is wide (big screens), always filling the column's height. */
  .sdk-suspects { flex: 1; grid-template-columns: repeat(auto-fill, minmax(max(180px, calc((100% - 0.6rem) / 3.2)), 1fr)); grid-auto-rows: minmax(min-content, 1fr); gap: 0.6rem; }

  /* Compact suspect cards: portrait + name in one row, clue below. */
  .sdk-person-head { flex-direction: row; align-items: center; gap: 0.55rem; padding: 0.35rem 0.5rem; text-align: left; }
  .sdk-person .sdk-token { width: 50px; max-width: none; margin: 0; flex: 0 0 50px; }
  .sdk-person-text { padding: 0; border: 0; background: transparent; color: var(--ink); min-width: 0; }
  .sdk-person-text strong { font-size: 1.45rem; }
  .sdk-person-text small { color: rgba(0, 0, 0, 0.6); }
  .sdk-person .sdk-clues { padding: 0.45rem 0.6rem 0.55rem; }
  .sdk-person .sdk-clue, .sdk-person .sdk-rule { font-size: 1.25rem; }
  .sdk-person.is-selected .sdk-person-text { background: transparent; }
  .sdk-person.is-selected .sdk-person-head { background: var(--yellow); }
  .sdk-person.is-victim .sdk-person-head { background: var(--red); }
  .sdk-person.is-victim .sdk-person-text, .sdk-person.is-victim .sdk-person-text small { color: var(--light); }
  .sdk-person.is-placed .sdk-person-head .sdk-token { opacity: 0.55; }

  /* Tools: bigger buttons, furniture key in the middle, verdict at the bottom. */
  .sdk-rail .sdk-tool { min-height: 52px; font-size: 1.35rem; }
  .sdk-legend { display: grid; gap: 0.5rem; margin-top: 0.4rem; padding-top: 0.8rem; border-top: 2px dashed var(--line); }
  .sdk-rail-end { margin-top: auto; }
  .sdk-submit { min-height: 64px; font-size: 1.6rem; }
}
.sdk-legend h4 { margin: 0; font-size: 1.1rem; text-transform: uppercase; color: var(--muted); }
.sdk-legend-row { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.sdk-legend-icon { display: block; width: 34px; height: 34px; background: #2f3b2c; border: 2px solid #000; padding: 2px; }
.sdk-legend-icon svg { width: 100%; height: 100%; display: block; }
.sdk-legend-text { flex-basis: 100%; font-size: 1.1rem; line-height: 1; }
.sdk-legend-row.is-no .sdk-legend-text { color: #f08a7e; }
.sdk-legend-row.is-ok .sdk-legend-text { color: #8fd18a; }
/* Short desktop windows (e.g. 1280×720 laptops): tighter left column so it ends with the board. */
@media (min-width: 1101px) and (max-height: 820px) {
  .sdk-game { gap: 0.6rem 1.2rem; }
  .sdk-game-meta, .sdk-suspects-col .sdk-col-title, .sdk-status-text span, .sdk-person-text small { display: none; }
  .sdk-game-titles h2 { font-size: 1.5rem; }
  .sdk-back { min-height: 0; padding: 0.1rem 0.6rem; font-size: 1.05rem; }
  .sdk-game-bar .sdk-timer { font-size: 1.6rem; }
  .sdk-board-col .sdk-status { min-height: 0; padding: 0.3rem 0.5rem; }
  .sdk-status-who, .sdk-status-who .sdk-token { width: 34px; height: 34px; flex-basis: 34px; }
  .sdk-status-text strong { font-size: 1.2rem; }
  .sdk-suspects { gap: 0.45rem; }
  .sdk-person-head { padding: 0.2rem 0.4rem; }
  .sdk-person .sdk-token { width: 38px; flex-basis: 38px; }
  .sdk-person-text strong { font-size: 1.3rem; }
  .sdk-person .sdk-clues { padding: 0.25rem 0.45rem 0.35rem; }
  .sdk-person .sdk-clue, .sdk-person .sdk-rule { font-size: 1.12rem; }
  .sdk-rail .sdk-tool { min-height: 44px; font-size: 1.2rem; }
  .sdk-submit { min-height: 52px; font-size: 1.4rem; }
}
/* Big screens (1440p and up): scale type, portraits and tools so the side columns keep up with the board. */
@media (min-width: 1800px) and (min-height: 1000px) {
  .sdk-game { --board: min(calc(100dvh - var(--site-nav-height) - 1.6rem), calc(100vw - 32px - 460px - 250px - 2.8rem), 1400px); grid-template-columns: minmax(460px, 1fr) var(--board) 250px; }
  .sdk-game-titles h2 { font-size: 2.3rem; }
  .sdk-game-meta { font-size: 1.3rem; }
  .sdk-game-bar .sdk-timer { font-size: 2.4rem; }
  .sdk-back { font-size: 1.4rem; }
  .sdk-board-col .sdk-status { padding: 0.6rem 0.8rem; }
  .sdk-status-who, .sdk-status-who .sdk-token { width: 56px; height: 56px; flex-basis: 56px; }
  .sdk-status-text strong { font-size: 1.7rem; }
  .sdk-status-text span { font-size: 1.35rem; }
  .sdk-suspects-col .sdk-col-title { font-size: 1.7rem; }
  .sdk-suspects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
  .sdk-person .sdk-token { width: 72px; flex-basis: 72px; }
  .sdk-person-text strong { font-size: 1.9rem; }
  .sdk-person-text small { font-size: 1.2rem; }
  .sdk-person .sdk-clue, .sdk-person .sdk-rule { font-size: 1.65rem; line-height: 1.15; }
  .sdk-rail .sdk-col-title { font-size: 1.9rem; }
  .sdk-rail .sdk-tool { min-height: 66px; font-size: 1.7rem; }
  .sdk-tool-icon { width: 2.2rem; height: 2.2rem; flex-basis: 2.2rem; font-size: 1.5rem; }
  .sdk-legend h4 { font-size: 1.4rem; }
  .sdk-legend-icon { width: 48px; height: 48px; }
  .sdk-legend-text { font-size: 1.4rem; }
  .sdk-submit { min-height: 84px; font-size: 2.1rem; }
  .sdk-room-label { font-size: 1.3rem; }
  .sdk-token-tag { font-size: 1.3rem; line-height: 18px; min-width: 22px; }
  .sdk-notes i { font-size: 1.2rem; line-height: 16px; min-width: 20px; }
}


/* ---------- board motion: squares stay put, only what changed moves ---------- */
/* Every layer of a square shares one grid slot, so a ✕ fading out never pushes the new one aside. */
.sdk-cell > * { grid-area: 1 / 1; }
.sdk-cell.is-flying { z-index: 8; }
.sdk-token { transition: box-shadow 0.2s ease, opacity 0.3s ease, filter 0.3s ease, outline-offset 0.2s ease; }
.sdk-person { transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.25s ease, opacity 0.2s ease, outline-color 0.2s ease; }
.sdk-person-head, .sdk-person-text, .sdk-pick { transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, opacity 0.2s ease; }

.sdk-main .is-leaving { animation: sdk-leave 0.22s ease var(--ld, 0ms) forwards !important; pointer-events: none; }
@keyframes sdk-leave { to { opacity: 0; transform: scale(0.35); } }

/* placing someone: a light runs out along their row and column, and ✕ marks stamp down behind it */
.sdk-sweep { position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0; background: rgba(255, 218, 61, 0.26); box-shadow: inset 0 0 0 2px rgba(255, 218, 61, 0.75); }
.sdk-sweep.is-on { animation: sdk-sweep 0.46s ease-out both; animation-delay: calc(var(--wave-lead, 80ms) + var(--d, 0ms) - 70ms); }
.sdk-sweep.is-origin { animation: sdk-sweep-origin 0.6s ease-out both; }
@keyframes sdk-sweep { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sdk-sweep-origin { 0% { opacity: 0; transform: scale(0.5); } 35% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.18); } }
.sdk-mark.is-wave { animation: sdk-x-stamp 0.34s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: calc(var(--wave-lead, 80ms) + var(--d, 0ms)); }
@keyframes sdk-x-stamp {
  0% { opacity: 0; transform: scale(1.9) rotate(-25deg); }
  55% { opacity: 1; transform: scale(0.8) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* clue highlight: the squares a picked suspect's clue points at */
.sdk-glow { position: absolute; inset: 0; pointer-events: none; z-index: 1; transition: background-color 0.25s ease; }
.sdk-glow::before, .sdk-glow::after { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 0.16s ease; }
.sdk-glow::before { background: rgba(255, 218, 61, 0.13); box-shadow: inset 0 0 0 3px rgba(255, 218, 61, 0.9); }
.sdk-glow::after { background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.55) 0 5px, rgba(232, 80, 70, 0.22) 5px 10px); }
.sdk-cell.is-lit .sdk-glow::before {
  opacity: 1;
  transition: opacity 0.22s ease var(--hd, 0ms);
  animation: sdk-glow-pulse 1.6s ease-in-out calc(var(--hd, 0ms) + 0.25s) infinite;
}
.sdk-cell.is-nope .sdk-glow::after { opacity: 1; transition: opacity 0.22s ease var(--hd, 0ms); }
@keyframes sdk-glow-pulse { 50% { background-color: rgba(255, 218, 61, 0.24); } }
/* the rest of the board steps back a little so the lit squares read at a glance */
.sdk-board.has-focus .sdk-cell:not(.is-lit):not(.is-target) .sdk-glow { background-color: rgba(0, 0, 0, 0.32); }
/* the furniture a clue names (the table you stand beside) bobs and gets a dashed frame */
.sdk-cell.is-target .sdk-feature { animation: sdk-bob 0.9s steps(2) infinite; }
.sdk-cell.is-target .sdk-glow { outline: 3px dashed rgba(255, 218, 61, 0.85); outline-offset: -5px; }
@keyframes sdk-bob { 50% { transform: translateY(-3px); } }

/* the other person a clue names */
.sdk-token.is-related, .sdk-person.is-related, .sdk-pick.is-related { outline: 3px dashed var(--yellow); outline-offset: 3px; animation: sdk-related 0.9s steps(2) infinite; }
.sdk-token.is-related.is-selected { animation: sdk-float 1.6s ease-in-out infinite; }
@keyframes sdk-related { 50% { outline-offset: 6px; } }

@media (prefers-reduced-motion: reduce) {
  .sdk-sweep { display: none; }
  .sdk-cell.is-lit .sdk-glow::before { animation: none; }
}

/* hovering a square outlines its room: a yellow line along the room's walls only */
.sdk-edge { position: absolute; inset: -1px; pointer-events: none; z-index: 4; opacity: 0; transition: opacity 0.15s ease; border: 0 solid var(--yellow); }
.sdk-cell.is-room-hover .sdk-edge { opacity: 1; }
.sdk-cell.is-room-hover.wall-t .sdk-edge { border-top-width: 8px; }
.sdk-cell.is-room-hover.wall-b .sdk-edge { border-bottom-width: 8px; }
.sdk-cell.is-room-hover.wall-l .sdk-edge { border-left-width: 8px; }
.sdk-cell.is-room-hover.wall-r .sdk-edge { border-right-width: 8px; }
.sdk-cell.is-room-hover .sdk-room-label { background: var(--yellow); color: var(--ink); }
.sdk-room-label { transition: background-color 0.15s ease, color 0.15s ease; }
/* sit the line on top of the wall itself, not just inside it */
.sdk-cell.wall-t .sdk-edge { top: -4px; }
.sdk-cell.wall-b .sdk-edge { bottom: -4px; }
.sdk-cell.wall-l .sdk-edge { left: -4px; }
.sdk-cell.wall-r .sdk-edge { right: -4px; }

/* hovering a single square: white frame where someone can stand, red on furniture nobody can stand on */
.sdk-cell:hover:not(.is-blocked) { box-shadow: none; }
@media (hover: hover) {
  .sdk-cell:hover { z-index: 5; outline: 6px solid var(--light); outline-offset: -6px; }
  .sdk-cell.is-blocked:hover { outline-color: #ff5a4e; cursor: not-allowed; }
}
/* keep the room's name readable on top of the thicker outline */
.sdk-cell.is-room-hover .sdk-room-label { z-index: 5; }

/* room names at 1.5× so the areas read from a distance */
.sdk-room-label { font-size: clamp(1.2rem, 2.85vw, 1.6rem); padding: 0 6px; line-height: 1.15; }
.sdk-room-label::before { width: 10px; height: 10px; margin-right: 6px; vertical-align: 2px; }
@media (max-width: 520px) {
  .sdk-room-label { font-size: 1.2rem; padding: 0 4px; }
  .sdk-room-label::before { width: 8px; height: 8px; margin-right: 4px; vertical-align: 1px; }
}
@media (min-width: 1800px) and (min-height: 1000px) {
  .sdk-room-label { font-size: 1.95rem; }
}
/* in a one-square-wide room the bigger name wraps onto a second line instead of being cut */
.sdk-room-label { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: normal; word-break: keep-all; }
/* size the tag to its text; it only wraps when the room's top row is too narrow */
.sdk-room-label { width: max-content; }
@media (max-width: 520px) { .sdk-room-label::before { display: none; } }
/* stacking inside a square: ✕ marks under the room name, people on top of everything */
.sdk-room-label { z-index: 3; }
.sdk-cell .sdk-token { z-index: 4; }


/* ---------- desktop: adjustable left column, board with breathing room ---------- */
.sdk-split { display: none; }
@media (min-width: 1101px) {
  .sdk-game {
    --left: 380px;           /* smallest default width; dragging the divider sets an exact one */
    --rail: 190px;
    --col-gap: 1.4rem;
    --pad-x: 2rem;           /* empty space left and right of the board */
    --pad-y: 0.6rem;         /* and above / below it */
    --board: min(
      calc(100vh - var(--site-nav-height) - 1.6rem - 2 * var(--pad-y)),
      calc(100vw - 32px - var(--left) - var(--rail) - 2 * var(--col-gap) - 2 * var(--pad-x)),
      1400px);
    --board: min(
      calc(100dvh - var(--site-nav-height) - 1.6rem - 2 * var(--pad-y)),
      calc(100vw - 32px - var(--left) - var(--rail) - 2 * var(--col-gap) - 2 * var(--pad-x)),
      1400px);
    position: relative;
    /* Until the player drags the divider, the board fills the window height and the suspects take the rest. */
    grid-template-columns: minmax(var(--left), 1fr) calc(var(--board) + 2 * var(--pad-x)) var(--rail);
    grid-template-rows: auto auto minmax(0, 1fr);
    column-gap: var(--col-gap);
    /* columns always run the full window height; the board sits centred in its own space */
    height: calc(100vh - var(--site-nav-height) - 1.6rem);
    height: calc(100dvh - var(--site-nav-height) - 1.6rem);
  }
  .sdk-board { justify-self: center; align-self: center; }
  .sdk-game.has-left { grid-template-columns: var(--left) minmax(0, 1fr) var(--rail); }
  /* a narrow column scrolls its own cards instead of making the page taller */
  .sdk-suspects-col { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #444 transparent; padding-right: 4px; padding-bottom: 6px; }

  /* the divider between the suspects column and the board */
  .sdk-split {
    display: block;
    /* sits on the right edge of the first column, whatever its width, across the full height */
    grid-column: 1;
    grid-row: 1 / -1;
    justify-self: end;
    align-self: stretch;
    position: relative;
    margin-right: calc(-1 * var(--col-gap) / 2 - 9px);
    width: 18px;
    z-index: 6;
    cursor: col-resize;
    touch-action: none;
  }
  .sdk-split::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 8px;
    width: 2px;
    background: repeating-linear-gradient(180deg, rgba(245, 242, 234, 0.18) 0 6px, transparent 6px 12px);
    transition: background 0.15s ease;
  }
  /* pixel grip in the middle */
  .sdk-split::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 4px;
    width: 10px;
    height: 44px;
    margin-top: -22px;
    background-color: #161616;
    background-image: radial-gradient(circle, var(--muted) 1px, transparent 1.5px);
    border: 2px solid #000;
    box-shadow: inset 0 0 0 1px rgba(245, 242, 234, 0.15);
    background-size: 4px 6px;
    background-position: 1px 2px;
    transition: background-color 0.15s ease;
  }
  .sdk-split:hover::before, .sdk-split.is-dragging::before, .sdk-split:focus-visible::before { background: var(--yellow); }
  .sdk-split:hover::after, .sdk-split.is-dragging::after, .sdk-split:focus-visible::after { background-color: var(--yellow); background-image: radial-gradient(circle, #000 1px, transparent 1.5px); }
  .sdk-split:focus-visible { outline: none; }
  body.sdk-resizing, body.sdk-resizing * { cursor: col-resize !important; user-select: none !important; }
}
@media (min-width: 1800px) and (min-height: 1000px) {
  .sdk-game { --left: 460px; --rail: 250px; --pad-x: 3rem; --pad-y: 1rem; }
}


/* suspect cards: the whole card picks the person */
.sdk-person { cursor: pointer; }
span.sdk-clue { cursor: default; }


/* ---------- sound toggle (game bar) ---------- */
.sdk-sound {
  flex: 0 0 auto;
  width: 44px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #000;
  color: var(--yellow);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, color 0.15s ease;
}
/* pixel speaker drawn with gradients: box + cone, and sound waves that hide when muted */
.sdk-sound::before {
  content: '';
  width: 22px;
  height: 16px;
  background:
    linear-gradient(currentColor, currentColor) 0 5px / 5px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 5px 2px / 3px 12px no-repeat,
    linear-gradient(currentColor, currentColor) 8px 0 / 3px 16px no-repeat,
    linear-gradient(currentColor, currentColor) 14px 5px / 2px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 18px 2px / 2px 12px no-repeat;
}
.sdk-sound:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #000; }
.sdk-sound:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.sdk-sound.is-off { color: var(--muted); }
.sdk-sound.is-off::before {
  background:
    linear-gradient(currentColor, currentColor) 0 5px / 5px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 5px 2px / 3px 12px no-repeat,
    linear-gradient(currentColor, currentColor) 8px 0 / 3px 16px no-repeat,
    linear-gradient(45deg, transparent 42%, #ff5a4e 42% 58%, transparent 58%) 13px 3px / 9px 10px no-repeat,
    linear-gradient(-45deg, transparent 42%, #ff5a4e 42% 58%, transparent 58%) 13px 3px / 9px 10px no-repeat;
}
.sdk-sound:focus-visible { outline: 3px dashed var(--yellow); outline-offset: 2px; }
@media (min-width: 1101px) {
  .sdk-game-bar .sdk-sound { margin-left: auto; }
  .sdk-game-bar .sdk-sound + .sdk-timer { margin-left: 0; }
}
@media (max-width: 720px) { .sdk-sound { width: 40px; height: 40px; } }

/* the verdict stamp slams down (with its sound) */
.sdk-modal:not([hidden]) .sdk-stamp { animation: sdk-slam 0.32s cubic-bezier(0.3, 1.6, 0.5, 1) 0.2s both; }
@keyframes sdk-slam { from { opacity: 0; transform: scale(2.4) rotate(-12deg); } to { opacity: 1; transform: scale(1) rotate(-3deg); } }

/* =====================================================================================================
   HOME v2: full-screen pixel night-street hero, then a minimal catalog of case tiles.
   ===================================================================================================== */
body:not(.sdk-in-game) .sdk-main { padding-top: 0; }
.sdk-home { display: block; }

/* ---- hero ---- */
.sdk-hero {
  position: relative;
  display: grid;
  place-items: center;
  /* full window, edge to edge, even though the page column is narrower */
  width: 100vw;
  margin-inline: calc((100% - 100vw) / 2);
  height: 100vh;
  height: 100svh;
  min-height: 460px;
  padding: calc(var(--site-nav-height) + 1rem) 16px 3.5rem;
  overflow: hidden;
  background: #05050a;
  isolation: isolate;
  /* undo the old two-column hero */
  grid-template-columns: 1fr;
  gap: 0;
  align-items: center;
  margin-bottom: 0;
}
.sdk-hero h1.sdk-logo { font-size: inherit; text-shadow: none; color: inherit; }
.sdk-scene { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; z-index: -2; }
/* darken the middle a touch so the title reads over the street */
.sdk-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 60% 45% at 50% 46%, rgba(0, 0, 0, 0.55), transparent 75%); }
.sdk-hero-inner { display: grid; justify-items: center; gap: 1.1rem; text-align: center; transform: translateY(-4vh); }
.sdk-logo { display: grid; margin: 0; line-height: 0.82; text-transform: uppercase; letter-spacing: 0.02em; }
.sdk-logo span:first-child { font-size: clamp(2.4rem, 6vw, 4.6rem); color: var(--light); text-shadow: 4px 4px 0 #000; }
.sdk-logo span:last-child { font-size: clamp(4.6rem, 14vw, 10.5rem); color: var(--yellow); text-shadow: 6px 6px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000; }
.sdk-tagline { margin: 0; max-width: 34ch; font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.2; color: var(--light); text-shadow: 2px 2px 0 #000; }
.sdk-hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 0.4rem; }
.sdk-hero-btn {
  min-height: 52px;
  padding: 0.35rem 1.3rem;
  background: rgba(10, 10, 14, 0.85);
  color: var(--light);
  border: 3px solid var(--light);
  border-radius: 0;
  box-shadow: 4px 4px 0 #000;
  font-size: 1.5rem;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease, color 0.15s ease;
}
.sdk-hero-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000; }
.sdk-hero-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.sdk-hero-btn--main { background: var(--yellow); color: #000; border-color: #000; }
.sdk-hero-btn--ghost { background: transparent; border-color: rgba(245, 242, 234, 0.5); box-shadow: none; }
.sdk-hero-btn--ghost:hover { border-color: var(--light); box-shadow: none; }
.sdk-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  translate: -50% 0;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--yellow);
  font-size: 1.6rem;
  cursor: pointer;
  animation: sdk-cue 1.6s steps(2) infinite;
}
@keyframes sdk-cue { 50% { transform: translateY(6px); } }

/* ---- catalog ---- */
.sdk-catalog {
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--site-nav-height) + 1.6rem) 0 4rem;
}
.sdk-cat-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0 0 0.9rem; }
.sdk-cat-head + .sdk-tiles, .sdk-cat-head + .sdk-offer { margin-top: 0; }
.sdk-cat-head:not(:first-child) { margin-top: 2.6rem; }
.sdk-cat-head h2 { margin: 0; font-size: clamp(2rem, 3.4vw, 2.6rem); line-height: 1; color: var(--light); text-transform: uppercase; }
.sdk-cat-sub { font-size: 1.25rem; color: var(--muted); }
.sdk-cat-head .sdk-pass-badge { margin-left: auto; padding: 0.1rem 0.6rem; background: var(--yellow); color: #000; font-size: 1.1rem; text-transform: uppercase; }

.sdk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.sdk-tiles > li { display: block; }
.sdk-tiles--today { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 320px)); }
.sdk-tile {
  position: relative;
  display: grid;
  width: 100%;
  padding: 0;
  background: #111;
  color: var(--light);
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  text-align: left;
  animation: sdk-tile-in 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 30ms);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
@keyframes sdk-tile-in { from { opacity: 0; transform: translateY(8px); } }
.sdk-tile:hover { transform: translate(-3px, -3px); box-shadow: 7px 7px 0 #000; border-color: var(--yellow); }
.sdk-tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.sdk-tile-map { display: block; aspect-ratio: 1; }
.sdk-tile-map svg { display: block; width: 100%; height: 100%; }
.sdk-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; padding: 0.3rem 0.55rem 0.35rem; background: #000; }
.sdk-tile-no { font-size: 1.45rem; line-height: 1; color: var(--light); }
.sdk-tile-pips { display: flex; gap: 3px; }
.sdk-tile-pips i { width: 8px; height: 8px; background: #3a3a3a; }
.sdk-tile-pips i.on { background: var(--yellow); }
.sdk-tile--today .sdk-tile-no { font-size: 1.8rem; }
.sdk-tile--today .sdk-tile-pips i { width: 11px; height: 11px; }
.sdk-tile-flag { position: absolute; top: 8px; left: 8px; padding: 0.05rem 0.5rem; background: var(--yellow); color: #000; font-size: 1.2rem; text-transform: uppercase; box-shadow: 2px 2px 0 #000; }
.sdk-tile-badge { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 28px; height: 28px; font-size: 1.3rem; box-shadow: 2px 2px 0 #000; }
.sdk-tile-badge--done { background: var(--green); color: #000; }
.sdk-tile-badge--going { background: var(--yellow); color: #000; }
.sdk-tile.is-solved .sdk-tile-map { filter: saturate(0.5) brightness(0.75); }
/* locked: map greyed out under a pixel padlock */
.sdk-tile.is-locked .sdk-tile-map { filter: grayscale(1) brightness(0.45); }
.sdk-tile-lock {
  position: absolute;
  top: calc(50% - 14px);
  left: 50%;
  width: 24px;
  height: 28px;
  translate: -50% -50%;
  background:
    linear-gradient(var(--light), var(--light)) 4px 0 / 16px 3px no-repeat,
    linear-gradient(var(--light), var(--light)) 4px 0 / 3px 12px no-repeat,
    linear-gradient(var(--light), var(--light)) 17px 0 / 3px 12px no-repeat,
    linear-gradient(var(--light), var(--light)) 0 11px / 24px 17px no-repeat;
  filter: drop-shadow(2px 2px 0 #000);
}
.sdk-tile-lock::after { content: ''; position: absolute; left: 10px; top: 16px; width: 4px; height: 6px; background: #000; }
.sdk-tile.is-locked:hover { border-color: var(--light); }

/* pass offer: one compact bar above the locked archive */
.sdk-catalog .sdk-offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.2rem;
  margin: 0 0 1.2rem;
  padding: 0.8rem 1rem;
  background: #111;
  color: var(--light);
  border: 3px solid var(--yellow);
  box-shadow: 4px 4px 0 #000;
}
.sdk-offer-text { display: grid; gap: 0.15rem; }
.sdk-offer-text strong { font-size: 1.6rem; line-height: 1; color: var(--yellow); text-transform: uppercase; }
.sdk-offer-text > span { font-size: 1.2rem; color: var(--muted); }
.sdk-catalog .sdk-offer-actions { display: flex; align-items: center; gap: 0.9rem; }
.sdk-catalog .sdk-link { background: none; border: 0; color: var(--light); text-decoration: underline; font-size: 1.15rem; cursor: pointer; }
.sdk-catalog .sdk-redeem, .sdk-catalog .sdk-form-msg { flex-basis: 100%; }
.sdk-offer.is-flash { animation: sdk-offer-flash 0.25s steps(2) 4; }
@keyframes sdk-offer-flash { 50% { border-color: var(--light); box-shadow: 4px 4px 0 #000, 0 0 0 4px rgba(255, 218, 61, 0.35); } }

/* optional email for the pass code, under the pass offer */
.sdk-buy-email { flex-basis: 100%; display: grid; gap: 0.35rem; max-width: 460px; font-size: 1.15rem; }
.sdk-buy-email input[type="email"] {
  min-width: 0;
  padding: 0.5rem 0.7rem;
  background: var(--paper);
  color: var(--fg);
  border: 3px solid var(--ink);
  font: 1.3rem/1 var(--pixel-font);
}
.sdk-buy-email input:focus { outline: none; box-shadow: 3px 3px 0 var(--blue); }
.sdk-buy-email .sdk-sub-fine { font-size: 1.05rem; color: var(--muted); }

/* email sign-in (one-time code), under the pass offer */
.sdk-buy-as { flex-basis: 100%; margin: 0; font-size: 1.15rem; color: var(--muted); }
.sdk-buy-as strong { color: var(--light); word-break: break-all; }
.sdk-login input[type="email"] { text-transform: none; letter-spacing: 0; }
.sdk-login #sdkLoginCode { flex: 0 1 11rem; letter-spacing: 0.35em; font-size: 1.6rem; }
.sdk-login label strong { word-break: break-all; color: var(--yellow); }
.sdk-login .sdk-link { margin-top: 0.4rem; }
.sdk-catalog .sdk-link--fine { font-size: 1.05rem; color: var(--muted); }
.sdk-account { word-break: break-all; }
.sdk-account .sdk-link, .sdk-cat-head .sdk-link { font-size: inherit; padding: 0; }

/* rules dialog */
.sdk-rules-card { max-width: 560px; text-align: left; }
.sdk-rules-card h2 { margin: 0 0 0.8rem; font-size: 2.2rem; text-transform: uppercase; color: var(--yellow); }
.sdk-rules-list { margin: 0 0 0.8rem; padding-left: 1.4rem; display: grid; gap: 0.5rem; font-size: 1.3rem; line-height: 1.2; }
.sdk-rules-list strong { color: var(--yellow); }
.sdk-rules-card .sdk-rules-note { margin: 0 0 1rem; font-size: 1.1rem; color: var(--muted); line-height: 1.2; }

@media (max-width: 720px) {
  .sdk-hero { padding-bottom: 4rem; }
  .sdk-hero-inner { transform: none; gap: 0.9rem; }
  .sdk-hero-actions { display: grid; width: min(100%, 320px); gap: 0.6rem; }
  .sdk-hero-btn { min-height: 50px; font-size: 1.35rem; }
  .sdk-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
  .sdk-tiles--today { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
  .sdk-tile { border-width: 2px; box-shadow: 3px 3px 0 #000; }
  .sdk-tile-foot { padding: 0.2rem 0.4rem; }
  .sdk-tile-no { font-size: 1.15rem; }
  .sdk-tile-pips i { width: 6px; height: 6px; }
  .sdk-tile-flag, .sdk-tile-badge { top: 5px; }
  .sdk-tile-flag { left: 5px; font-size: 1rem; }
  .sdk-tile-badge { right: 5px; width: 22px; height: 22px; font-size: 1.05rem; }
  .sdk-catalog { padding-top: calc(var(--site-nav-height) + 1rem); }
  .sdk-cat-head:not(:first-child) { margin-top: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) { .sdk-scroll-cue, .sdk-tile { animation: none; } }
.sdk-catalog .sdk-offer-actions { flex-direction: row; flex-wrap: nowrap; }

/* ---- hero v2: ASCII detective at his desk ---- */
.sdk-scene { image-rendering: auto; }
.sdk-hero::after { background: linear-gradient(90deg, rgba(5, 5, 7, 0.82) 0%, rgba(5, 5, 7, 0.45) 38%, transparent 62%); }
@media (min-width: 900px) {
  .sdk-hero { place-items: center start; padding-left: max(5vw, 32px); }
  .sdk-hero-inner { justify-items: start; text-align: left; max-width: min(46vw, 640px); transform: none; }
  .sdk-hero-actions { justify-content: flex-start; }
}
@media (max-width: 899px) {
  .sdk-hero { align-items: start; }
  .sdk-hero::after { background: linear-gradient(180deg, rgba(5, 5, 7, 0.85) 0%, rgba(5, 5, 7, 0.55) 45%, transparent 70%); }
  .sdk-hero-inner { padding-top: 2vh; }
}

/* ---- catalog v2: manila case-file envelopes with the floor plan peeking out ---- */
.sdk-tiles { gap: 1.6rem 1.2rem; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }
.sdk-tiles--today { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 280px)); gap: 1.6rem; }
.sdk-env {
  --manila: #d6b077;
  --manila-dark: #b48a52;
  --ink: #2b2420;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.3, 1.2);
  animation: sdk-env-in 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 28ms);
}
@keyframes sdk-env-in { from { opacity: 0; transform: translateY(14px) rotate(var(--tilt, 0deg)); } }
/* back of the envelope, with its flap folded open behind the plan */
.sdk-env-back {
  position: absolute;
  left: 0; right: 0; top: 16%; bottom: 0;
  background: var(--manila-dark);
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
}
.sdk-env-back::before {
  content: '';
  position: absolute;
  left: 6%; right: 6%; top: -15%; height: 16%;
  background: #c39a5f;
  border: 3px solid #000;
  border-bottom: 0;
  clip-path: polygon(0 100%, 8% 0, 92% 0, 100% 100%);
}
/* the floor plan on its card */
.sdk-env-card {
  position: absolute;
  left: 9%; right: 9%; top: 5%;
  aspect-ratio: 1;
  padding: 5px;
  background: #f4ecd8;
  border: 2px solid #000;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.3, 1.3);
}
.sdk-env-card svg, .sdk-env-card .sdk-map-img { display: block; width: 100%; height: 100%; }
.sdk-map-img { object-fit: contain; -webkit-user-drag: none; user-select: none; }
/* coming back from a case re-draws the catalog: no second entry animation */
.sdk-tiles.is-settled .sdk-env { animation: none; }
/* front pocket */
.sdk-env-front {
  position: absolute;
  left: 0; right: 0; bottom: 0; height: 58%;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0 4px, transparent 4px),
    repeating-linear-gradient(0deg, rgba(120, 80, 30, 0.06) 0 2px, transparent 2px 5px),
    var(--manila);
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
  transition: transform 0.25s ease;
}
/* string-and-button closure, the classic interoffice envelope */
.sdk-env-string { position: absolute; top: 10px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border: 3px solid var(--ink); border-radius: 50%; background: #c39a5f; }
.sdk-env-string::after { content: ''; position: absolute; top: 4px; left: 9px; width: 34px; height: 2px; background: #6b4a2a; transform: rotate(24deg); transform-origin: left center; }
/* the typed label */
.sdk-env-label {
  position: absolute;
  left: 9%; bottom: 14%;
  display: grid;
  padding: 0.15rem 0.5rem 0.1rem;
  background: #f4ecd8;
  border: 2px solid var(--ink);
  color: var(--ink);
  transform: rotate(-1.5deg);
}
.sdk-env-kicker { font-size: 0.95rem; line-height: 1; text-transform: uppercase; opacity: 0.7; }
.sdk-env-no { font-size: 2rem; line-height: 0.95; }
.sdk-env-pips { position: absolute; right: 9%; bottom: 16%; display: flex; gap: 3px; }
.sdk-env-pips i { width: 9px; height: 9px; border: 2px solid var(--ink); }
.sdk-env-pips i.on { background: var(--ink); }
/* rubber stamps */
.sdk-env-stamp {
  position: absolute;
  right: 7%; top: 20%;
  padding: 0 0.4rem;
  border: 3px solid currentColor;
  font-size: 1.25rem;
  line-height: 1.1;
  text-transform: uppercase;
  transform: rotate(-12deg);
  opacity: 0.88;
}
.sdk-env-stamp--done { color: #2f7a43; }
.sdk-env-stamp--secret { color: #b8322a; }
/* in progress: a paper clip on the plan */
.sdk-env-clip { position: absolute; top: 1%; right: 16%; width: 12px; height: 32px; border: 3px solid #9aa0a8; border-bottom: 0; border-radius: 6px 6px 0 0; z-index: 2; }
.sdk-env-clip::after { content: ''; position: absolute; left: 2px; top: 6px; width: 2px; height: 20px; background: #9aa0a8; }
/* solved: the plan looks filed away */
.sdk-env.is-solved .sdk-env-card { filter: saturate(0.6); }
/* locked: sealed, the plan pushed down out of sight, a padlock on the pocket */
.sdk-env.is-locked .sdk-env-card { transform: translateY(26%); filter: grayscale(1) brightness(0.8); }
.sdk-env.is-locked .sdk-env-front { --manila: #b9a283; }
.sdk-env-front .sdk-tile-lock { top: auto; bottom: 30%; left: 50%; translate: -50% 0; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.5)); background:
    linear-gradient(var(--ink), var(--ink)) 4px 0 / 16px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 4px 0 / 3px 12px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 17px 0 / 3px 12px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 11px / 24px 17px no-repeat; }
.sdk-env-front .sdk-tile-lock::after { background: #b9a283; }

/* hover: pick it up and slide the plan out a little */
.sdk-env:hover, .sdk-env:focus-visible { transform: rotate(0deg) translateY(-4px); }
.sdk-env:hover .sdk-env-card, .sdk-env:focus-visible .sdk-env-card { transform: translateY(-9%); }
.sdk-env.is-locked:hover .sdk-env-card { transform: translateY(20%); }
.sdk-env:focus-visible { outline: 3px dashed var(--yellow); outline-offset: 6px; }
/* click: pull the plan out of the envelope, then the case opens */
.sdk-env.is-opening { z-index: 5; transform: rotate(0deg); }
.sdk-env.is-opening .sdk-env-card { animation: sdk-env-pull 0.62s cubic-bezier(0.3, 0.7, 0.2, 1) forwards; z-index: 3; }
.sdk-env.is-opening .sdk-env-front { animation: sdk-env-drop 0.62s ease-in forwards; }
.sdk-env.is-opening .sdk-env-back { animation: sdk-env-drop 0.62s ease-in 0.05s forwards; }
@keyframes sdk-env-pull {
  0% { transform: translateY(0); }
  45% { transform: translateY(-62%) rotate(-2deg); opacity: 1; }
  75% { transform: translateY(-52%) rotate(0deg) scale(1.18); opacity: 1; }
  100% { transform: translateY(-48%) scale(1.45); opacity: 0; }
}
@keyframes sdk-env-drop { 0%, 35% { transform: none; opacity: 1; } 100% { transform: translateY(45%); opacity: 0; } }
/* locked click: a little "no" shake */
.sdk-env.is-denied { animation: sdk-env-no 0.32s steps(2) 2; }
@keyframes sdk-env-no { 50% { transform: translateX(5px) rotate(var(--tilt, 0deg)); } }

.sdk-env--today .sdk-env-no { font-size: 2.6rem; }
.sdk-env--today .sdk-env-kicker { font-size: 1.1rem; opacity: 0.85; }
.sdk-env--today .sdk-env-pips i { width: 12px; height: 12px; }

@media (max-width: 720px) {
  .sdk-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem 0.7rem; }
  .sdk-tiles--today { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .sdk-env-back, .sdk-env-front { border-width: 2px; box-shadow: 3px 3px 0 #000; }
  .sdk-env-card { padding: 3px; border-width: 1px; }
  .sdk-env-string { top: 6px; width: 10px; height: 10px; margin-left: -5px; border-width: 2px; }
  .sdk-env-string::after { top: 2px; left: 6px; width: 20px; }
  .sdk-env-label { padding: 0.05rem 0.3rem; border-width: 1px; }
  .sdk-env-kicker { font-size: 0.75rem; }
  .sdk-env-no { font-size: 1.35rem; }
  .sdk-env--today .sdk-env-no { font-size: 1.9rem; }
  .sdk-env-pips { gap: 2px; }
  .sdk-env-pips i { width: 6px; height: 6px; border-width: 1px; }
  .sdk-env-stamp { font-size: 0.85rem; border-width: 2px; padding: 0 0.2rem; }
  .sdk-env-front .sdk-tile-lock { transform: scale(0.7); }
}
@media (prefers-reduced-motion: reduce) { .sdk-env { animation: none; transition: none; } }
.sdk-env-front .sdk-tile-lock { left: auto; right: 11%; bottom: 34%; translate: none; }
.sdk-env-stamp--secret { top: 14%; }

/* ---- envelopes in the brand colours: black files, yellow accents ---- */
.sdk-env { --manila: #151515; --manila-dark: #0a0a0a; --ink: #0a0a0a; }
.sdk-env-back { background: #0b0b0b; border-color: #000; box-shadow: 5px 5px 0 #000, inset 0 0 0 1px rgba(255, 218, 61, 0.18); }
.sdk-env-back::before { background: #1c1c1c; border-color: #000; box-shadow: inset 0 2px 0 rgba(255, 218, 61, 0.35); }
.sdk-env-front {
  background:
    linear-gradient(180deg, var(--yellow) 0 3px, transparent 3px),                    /* yellow edge along the opening */
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 5px), /* fibre texture */
    var(--manila);
  border-color: #000;
  box-shadow: 5px 5px 0 #000, inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.sdk-env-string { background: var(--yellow); border-color: #000; }
.sdk-env-string::after { background: rgba(255, 218, 61, 0.6); }
.sdk-env-label { background: var(--yellow); border-color: #000; color: #0a0a0a; box-shadow: 2px 2px 0 #000; }
.sdk-env-kicker { opacity: 0.75; }
.sdk-env-pips i { border-color: rgba(255, 218, 61, 0.6); }
.sdk-env-pips i.on { background: var(--yellow); border-color: var(--yellow); }
.sdk-env-stamp--done { color: #5fd16a; }
.sdk-env-stamp--secret { color: #ff5a4e; }
.sdk-env-clip { border-color: var(--yellow); }
.sdk-env-clip::after { background: var(--yellow); }
/* hover: the yellow edge brightens like a lit desk */
.sdk-env:hover .sdk-env-front, .sdk-env:focus-visible .sdk-env-front { box-shadow: 5px 5px 0 #000, inset 0 0 0 2px rgba(255, 218, 61, 0.55); }
/* locked: darker still, plan hidden, padlock and label greyed */
.sdk-env.is-locked .sdk-env-front { --manila: #101010; }
.sdk-env.is-locked .sdk-env-label { background: #8a8578; }
.sdk-env-front .sdk-tile-lock { background:
    linear-gradient(#8a8578, #8a8578) 4px 0 / 16px 3px no-repeat,
    linear-gradient(#8a8578, #8a8578) 4px 0 / 3px 12px no-repeat,
    linear-gradient(#8a8578, #8a8578) 17px 0 / 3px 12px no-repeat,
    linear-gradient(#8a8578, #8a8578) 0 11px / 24px 17px no-repeat; }
.sdk-env-front .sdk-tile-lock::after { background: #101010; }

/* ---- case file pulled out of its envelope ---- */
.sdk-env.is-out .sdk-env-card { visibility: hidden; }  /* the file is out, the envelope is empty */
.sdk-peek {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: calc(var(--site-nav-height) + 1rem) 16px 1.5rem;
  background: rgba(0, 0, 0, 0);
  transition: background-color 0.3s ease;
}
.sdk-peek.is-open { background: rgba(0, 0, 0, 0.78); }
.sdk-peek.is-closing { background: rgba(0, 0, 0, 0); }
.sdk-peek-inner { display: grid; justify-items: center; gap: 1rem; }
.sdk-peek-card {
  width: min(56vh, 86vw, 440px);
  aspect-ratio: 1;
  padding: 10px;
  background: #f4ecd8;
  border: 3px solid #000;
  box-shadow: 8px 8px 0 #000, 0 0 0 3px var(--yellow);
  transform: rotate(-1.5deg);
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}
.sdk-peek-card svg, .sdk-peek-card .sdk-map-img { display: block; width: 100%; height: 100%; }
.sdk-peek-card .sdk-map-img { image-rendering: pixelated; }
.sdk-peek-card { will-change: transform; }
.sdk-peek-card:hover { box-shadow: 8px 8px 0 #000, 0 0 0 5px var(--yellow); }
.sdk-peek-meta, .sdk-peek-actions { opacity: 0; transform: translateY(8px); transition: opacity 0.25s ease 0.3s, transform 0.25s ease 0.3s; }
.sdk-peek.is-open .sdk-peek-meta, .sdk-peek.is-open .sdk-peek-actions { opacity: 1; transform: none; }
.sdk-peek.is-closing .sdk-peek-meta, .sdk-peek.is-closing .sdk-peek-actions { opacity: 0; transition-delay: 0s; transition-duration: 0.12s; }
.sdk-peek-meta { display: grid; justify-items: center; gap: 0.3rem; color: var(--light); text-align: center; }
.sdk-peek-no { font-size: 2.2rem; line-height: 1; color: var(--yellow); text-transform: uppercase; text-shadow: 3px 3px 0 #000; }
.sdk-peek-facts { display: flex; align-items: center; gap: 0.7rem; font-size: 1.3rem; color: var(--muted); }
.sdk-peek-facts .sdk-env-pips { position: static; }
.sdk-peek-facts .sdk-env-pips i { border-color: rgba(255, 218, 61, 0.6); }
.sdk-peek-facts .sdk-env-pips i.on { background: var(--yellow); border-color: var(--yellow); }
.sdk-peek-state { padding: 0 0.4rem; border: 2px solid var(--muted); text-transform: uppercase; font-size: 1.05rem; }
.sdk-peek-state.is-done { color: #5fd16a; border-color: #5fd16a; }
.sdk-peek-state.is-going { color: var(--yellow); border-color: var(--yellow); }
.sdk-peek-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }

/* ---- loader: opening the file ---- */
.sdk-loader {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: #050505;
  color: var(--light);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sdk-loader.is-on { opacity: 1; }
.sdk-loader.is-leaving { opacity: 0; transition-duration: 0.35s; }
.sdk-loader-inner { display: grid; justify-items: center; gap: 0.9rem; font-family: var(--pixel-font); }
/* a pixel folder whose pages flip */
.sdk-loader-folder { position: relative; width: 84px; height: 64px; }
.sdk-loader-folder::before { content: ''; position: absolute; left: 0; top: 0; width: 34px; height: 12px; background: #1c1c1c; border: 3px solid var(--yellow); border-bottom: 0; }
.sdk-loader-folder::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 52px; background: #151515; border: 3px solid var(--yellow); box-shadow: 4px 4px 0 #000; }
.sdk-loader-folder i { position: absolute; left: 12px; right: 12px; bottom: 14px; height: 40px; background: #f4ecd8; border: 2px solid #000; z-index: 1; transform-origin: bottom center; animation: sdk-page 0.9s steps(3) infinite; }
.sdk-loader-folder i:nth-child(2) { animation-delay: 0.3s; left: 16px; right: 8px; }
.sdk-loader-folder i:nth-child(3) { animation-delay: 0.6s; left: 8px; right: 16px; }
@keyframes sdk-page { 0% { transform: translateY(0); } 50% { transform: translateY(-14px) rotate(-6deg); } 100% { transform: translateY(0); } }
.sdk-loader-text { margin: 0; font-size: 1.9rem; color: var(--yellow); text-transform: uppercase; letter-spacing: 0.04em; }
.sdk-loader-caret { animation: sdk-blink 0.6s steps(2) infinite; }
@keyframes sdk-blink { 50% { opacity: 0; } }
.sdk-loader-bar { display: flex; gap: 4px; padding: 4px; border: 3px solid var(--light); }
.sdk-loader-bar i { width: 14px; height: 18px; background: #222; }
.sdk-loader.is-on .sdk-loader-bar i { animation: sdk-fill 0.9s steps(1) forwards; }
.sdk-loader-bar i:nth-child(1) { animation-delay: 0.0s !important; }
.sdk-loader-bar i:nth-child(2) { animation-delay: 0.06s !important; }
.sdk-loader-bar i:nth-child(3) { animation-delay: 0.12s !important; }
.sdk-loader-bar i:nth-child(4) { animation-delay: 0.2s !important; }
.sdk-loader-bar i:nth-child(5) { animation-delay: 0.26s !important; }
.sdk-loader-bar i:nth-child(6) { animation-delay: 0.34s !important; }
.sdk-loader-bar i:nth-child(7) { animation-delay: 0.42s !important; }
.sdk-loader-bar i:nth-child(8) { animation-delay: 0.5s !important; }
.sdk-loader-bar i:nth-child(9) { animation-delay: 0.6s !important; }
.sdk-loader-bar i:nth-child(10) { animation-delay: 0.68s !important; }
.sdk-loader-bar i:nth-child(11) { animation-delay: 0.76s !important; }
.sdk-loader-bar i:nth-child(12) { animation-delay: 0.82s !important; }
@keyframes sdk-fill { to { background: var(--yellow); } }
.sdk-loader-line { margin: 0; min-height: 1.4em; font-size: 1.2rem; color: var(--muted); }
@media (max-width: 720px) {
  .sdk-loader-text { font-size: 1.5rem; }
  .sdk-loader-bar i { width: 10px; height: 14px; }
  .sdk-peek-no { font-size: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sdk-loader-folder i, .sdk-loader-caret { animation: none; }
  .sdk-loader.is-on .sdk-loader-bar i { animation: none; background: var(--yellow); }
}

/* ---- furniture key: names, coloured by whether you can stand on it ---- */
.sdk-legend-list { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.sdk-legend-item { display: flex; align-items: center; gap: 0.5rem; padding: 2px 6px 2px 2px; border: 2px solid currentColor; font-size: 1.15rem; line-height: 1; }
.sdk-legend-item .sdk-legend-icon { flex: 0 0 auto; width: 30px; height: 30px; border-color: currentColor; }
.sdk-legend-item.is-no { color: #f08a7e; background: rgba(240, 138, 126, 0.08); }
.sdk-legend-item.is-ok { color: #8fd18a; background: rgba(143, 209, 138, 0.08); }
.sdk-legend-name { color: var(--light); }
@media (min-width: 1800px) and (min-height: 1000px) { .sdk-legend-item { font-size: 1.45rem; } .sdk-legend-item .sdk-legend-icon { width: 42px; height: 42px; } }
@media (max-width: 1100px) { .sdk-legend-list { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }

/* ---- result: how you compare, and the shareable image ---- */
.sdk-rank { margin: 0.9rem 0 0.2rem; padding: 0.7rem 0.8rem 0.5rem; background: #111; border: 2px solid #2a2a2a; text-align: left; }
.sdk-rank-head { margin: 0 0 0.4rem; font-size: 1.45rem; line-height: 1.1; color: var(--light); }
.sdk-rank-head strong { color: var(--yellow); font-size: 1.9rem; }
.sdk-curve svg { display: block; width: 100%; height: auto; }
.sdk-rank-note { margin: 0.35rem 0 0; font-size: 1rem; line-height: 1.15; color: var(--muted); }
.sdk-shot { margin: 0.9rem auto 0; width: min(200px, 50%); }
.sdk-shot img { display: block; width: 100%; height: auto; border: 3px solid #000; box-shadow: 5px 5px 0 #000, 0 0 0 2px var(--yellow); }
#sdkResult .sdk-modal-card { max-height: calc(100dvh - 2rem); overflow-y: auto; }

/* CURSOR:START (written by scripts/sudoku/make-cursor.js) */
/* The pixel detective cursor. Clickable things get the lit-lens version; text fields, the column divider
   and blocked squares keep their own cursors. Phones and tablets have no cursor, so nothing changes there. */
.sudoku-page { --sdk-cursor: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2016%2016%22%20shape-rendering%3D%22crispEdges%22%3E%3Cpath%20fill%3D%22%230a0a0a%22%20d%3D%22M1%200h4v1h-4zM0%201h1v1h-1zM5%201h1v1h-1zM0%202h1v1h-1zM5%202h1v1h-1zM10%202h4v1h-4zM0%203h1v1h-1zM5%203h1v1h-1zM9%203h1v1h-1zM14%203h1v1h-1zM0%204h1v1h-1zM5%204h1v1h-1zM9%204h1v1h-1zM14%204h1v1h-1zM1%205h4v1h-4zM8%205h1v1h-1zM15%205h1v1h-1zM8%206h1v1h-1zM15%206h1v1h-1zM7%207h2v1h-2zM13%207h1v1h-1zM8%208h1v1h-1zM10%208h1v1h-1zM13%208h1v1h-1zM7%209h1v1h-1zM9%209h1v1h-1zM12%209h2v1h-2zM6%2010h1v1h-1zM10%2010h2v1h-2zM14%2010h1v1h-1zM5%2011h1v1h-1zM15%2011h1v1h-1zM5%2012h1v1h-1zM15%2012h1v1h-1zM5%2013h1v1h-1zM15%2013h1v1h-1zM6%2014h1v1h-1zM14%2014h1v1h-1zM6%2015h3v1h-3zM12%2015h3v1h-3z%22%2F%3E%3Cpath%20fill%3D%22%23cfd8dc%22%20d%3D%22M1%201h4v1h-4zM1%202h1v1h-1zM3%202h2v1h-2zM1%203h4v1h-4zM1%204h4v1h-4z%22%2F%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M2%202h1v1h-1z%22%2F%3E%3Cpath%20fill%3D%22%231e1e1e%22%20d%3D%22M10%203h4v1h-4zM10%204h4v1h-4zM9%206h6v1h-6z%22%2F%3E%3Cpath%20fill%3D%22%236b4a2a%22%20d%3D%22M5%205h1v1h-1zM5%206h2v1h-2zM6%207h1v1h-1zM7%208h1v1h-1zM8%209h1v1h-1zM8%2010h1v1h-1z%22%2F%3E%3Cpath%20fill%3D%22%23ffda3d%22%20d%3D%22M9%205h6v1h-6z%22%2F%3E%3Cpath%20fill%3D%22%23e0b48a%22%20d%3D%22M9%207h4v1h-4zM9%208h1v1h-1zM11%208h2v1h-2zM10%209h2v1h-2z%22%2F%3E%3Cpath%20fill%3D%22%23c9a46a%22%20d%3D%22M7%2010h1v1h-1zM9%2010h1v1h-1zM12%2010h2v1h-2zM6%2011h6v1h-6zM13%2011h2v1h-2zM6%2012h2v1h-2zM9%2012h3v1h-3zM13%2012h2v1h-2zM6%2013h2v1h-2zM9%2013h3v1h-3zM13%2013h2v1h-2zM7%2014h4v1h-4zM12%2014h2v1h-2z%22%2F%3E%3Cpath%20fill%3D%22%239a7a4a%22%20d%3D%22M12%2011h1v1h-1zM8%2012h1v1h-1zM12%2012h1v1h-1zM8%2013h1v1h-1zM12%2013h1v1h-1zM11%2014h1v1h-1z%22%2F%3E%3C%2Fsvg%3E") 6 6, auto; --sdk-cursor-pointer: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2016%2016%22%20shape-rendering%3D%22crispEdges%22%3E%3Cpath%20fill%3D%22%230a0a0a%22%20d%3D%22M1%200h4v1h-4zM0%201h1v1h-1zM5%201h1v1h-1zM0%202h1v1h-1zM5%202h1v1h-1zM10%202h4v1h-4zM0%203h1v1h-1zM5%203h1v1h-1zM9%203h1v1h-1zM14%203h1v1h-1zM0%204h1v1h-1zM5%204h1v1h-1zM9%204h1v1h-1zM14%204h1v1h-1zM1%205h4v1h-4zM8%205h1v1h-1zM15%205h1v1h-1zM8%206h1v1h-1zM15%206h1v1h-1zM7%207h2v1h-2zM13%207h1v1h-1zM8%208h1v1h-1zM10%208h1v1h-1zM13%208h1v1h-1zM7%209h1v1h-1zM9%209h1v1h-1zM12%209h2v1h-2zM6%2010h1v1h-1zM10%2010h2v1h-2zM14%2010h1v1h-1zM5%2011h1v1h-1zM15%2011h1v1h-1zM5%2012h1v1h-1zM15%2012h1v1h-1zM5%2013h1v1h-1zM15%2013h1v1h-1zM6%2014h1v1h-1zM14%2014h1v1h-1zM6%2015h3v1h-3zM12%2015h3v1h-3z%22%2F%3E%3Cpath%20fill%3D%22%23ffda3d%22%20d%3D%22M1%201h4v1h-4zM1%202h1v1h-1zM3%202h2v1h-2zM1%203h4v1h-4zM1%204h4v1h-4zM9%205h6v1h-6z%22%2F%3E%3Cpath%20fill%3D%22%23fff7d1%22%20d%3D%22M2%202h1v1h-1z%22%2F%3E%3Cpath%20fill%3D%22%231e1e1e%22%20d%3D%22M10%203h4v1h-4zM10%204h4v1h-4zM9%206h6v1h-6z%22%2F%3E%3Cpath%20fill%3D%22%236b4a2a%22%20d%3D%22M5%205h1v1h-1zM5%206h2v1h-2zM6%207h1v1h-1zM7%208h1v1h-1zM8%209h1v1h-1zM8%2010h1v1h-1z%22%2F%3E%3Cpath%20fill%3D%22%23e0b48a%22%20d%3D%22M9%207h4v1h-4zM9%208h1v1h-1zM11%208h2v1h-2zM10%209h2v1h-2z%22%2F%3E%3Cpath%20fill%3D%22%23c9a46a%22%20d%3D%22M7%2010h1v1h-1zM9%2010h1v1h-1zM12%2010h2v1h-2zM6%2011h6v1h-6zM13%2011h2v1h-2zM6%2012h2v1h-2zM9%2012h3v1h-3zM13%2012h2v1h-2zM6%2013h2v1h-2zM9%2013h3v1h-3zM13%2013h2v1h-2zM7%2014h4v1h-4zM12%2014h2v1h-2z%22%2F%3E%3Cpath%20fill%3D%22%239a7a4a%22%20d%3D%22M12%2011h1v1h-1zM8%2012h1v1h-1zM12%2012h1v1h-1zM8%2013h1v1h-1zM12%2013h1v1h-1zM11%2014h1v1h-1z%22%2F%3E%3C%2Fsvg%3E") 6 6, pointer; }
.sudoku-page, .sudoku-page * { cursor: var(--sdk-cursor); }
.sudoku-page :is(a, button, label, summary, select, [role="button"], .sdk-cell, .sdk-env, .sdk-person, .sdk-person-head, .sdk-pick, .sdk-tile, .sdk-peek-card, .sdk-clue) { cursor: var(--sdk-cursor-pointer); }
.sudoku-page :is(input, textarea) { cursor: text; }
.sudoku-page .sdk-split { cursor: col-resize; }
.sudoku-page .sdk-cell.is-blocked, .sudoku-page button:disabled { cursor: not-allowed; }
/* CURSOR:END */

/* =====================================================================================================
   Room names: one line, room above for Vietnamese stacked accents, allowed to run past the room.
   ===================================================================================================== */
.sdk-room-label {
  display: block;
  width: max-content;
  max-width: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  -webkit-line-clamp: unset;
  line-clamp: none;
  /* stacked marks like Ấ, Ổ, Ữ sit above the capital: give them space inside the tag */
  padding-top: 0.2em;
  line-height: 1.2;
}
/* pointing at a room lights its name and brings it above any room it runs into */
.sdk-cell.is-room-hover { z-index: 6; }
.sdk-cell.is-room-hover .sdk-room-label { z-index: 7; background: var(--yellow); color: var(--ink); box-shadow: 2px 2px 0 #000; }

/* =====================================================================================================
   Phone game screen (≤720px): one screen, nothing scrolls but the clue card.
     top    – the board
     middle – case bar, the whole cast as one row of portraits, then the clue card of whoever is picked
     bottom – the tools, with "Chỉ ra hung thủ" as one more button in the same row
   (The status line and the suspect cards are hidden here; the clue card stands in for both.)
   The site navigation is hidden while playing; ◀ in the case bar goes back to the cases.
   ===================================================================================================== */
@media (max-width: 720px) {
  body.sdk-in-game .site-nav { display: none; }
  body.sdk-in-game { overflow: hidden; }
  body.sdk-in-game .sdk-main {
    height: 100vh;
    height: 100dvh;
    padding: calc(8px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom));
    overflow: hidden;
  }
  body.sdk-in-game .sdk-game {
    display: grid;
    height: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    grid-template-areas: 'board' 'bar' 'picker' 'card' 'rail';
    gap: 8px;
    margin: 0;
  }
  body.sdk-in-game .sdk-play,
  body.sdk-in-game .sdk-board-col { display: contents; }
  body.sdk-in-game .sdk-split,
  body.sdk-in-game .sdk-picker,
  body.sdk-in-game .sdk-legend { display: none !important; }

  /* top: the board, as wide as the screen but leaving room for the strip and a readable clue card */
  body.sdk-in-game .sdk-board {
    grid-area: board;
    justify-self: center;
    align-self: start;
    width: min(100%, calc(100vh - 400px));
    width: min(100%, calc(100dvh - 400px));
    margin: 0;
  }

  /* middle, first line: back, case name, sound, timer */
  body.sdk-in-game .sdk-game-bar { grid-area: bar; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0; }
  body.sdk-in-game .sdk-back { min-height: 34px; padding: 0 0.6rem; }
  body.sdk-in-game .sdk-back-text, body.sdk-in-game .sdk-game-meta { display: none; }
  body.sdk-in-game .sdk-game-titles { order: 0; flex: 1 1 auto; min-width: 0; }
  body.sdk-in-game .sdk-game-titles h2 { font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.sdk-in-game .sdk-sound { width: 34px; height: 34px; }
  body.sdk-in-game .sdk-timer { font-size: 1.35rem; min-width: 3.8rem; margin-left: 0; padding: 0 0.4rem; }

  /* the status line and the cards are replaced by the strip + clue card below */
  body.sdk-in-game .sdk-board-col .sdk-status,
  body.sdk-in-game .sdk-suspects-col { display: none !important; }

  /* bottom: five equal tools in one row, the verdict button last */
  body.sdk-in-game .sdk-rail {
    grid-area: rail;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    position: relative;
    top: auto; /* the desktop column is sticky with a top offset */
  }
  body.sdk-in-game .sdk-rail .sdk-col-title { display: none; }
  body.sdk-in-game .sdk-rail-end { display: contents; }
  body.sdk-in-game .sdk-rail .sdk-tool,
  body.sdk-in-game .sdk-rail .sdk-submit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    width: 100%;
    min-height: 56px;
    padding: 0.3rem 0.1rem;
    font-size: 0.95rem;
    line-height: 1;
    text-align: center;
    box-shadow: 3px 3px 0 var(--ink);
  }
  body.sdk-in-game .sdk-rail .sdk-tool small { display: none; }
  body.sdk-in-game .sdk-rail .sdk-submit { text-transform: none; }
  body.sdk-in-game .sdk-rail .sdk-submit::before { content: '⚖'; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; background: var(--ink); color: var(--yellow); font-size: 1.1rem; }
  body.sdk-in-game .sdk-rail .sdk-submit[disabled] { opacity: 0.45; }
  /* the verdict message floats just above the tools instead of taking a row */
  body.sdk-in-game .sdk-rail .sdk-form-msg { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); margin: 0; padding: 0.3rem 0.5rem; background: var(--ink); color: var(--light); font-size: 1rem; z-index: 8; }
  body.sdk-in-game .sdk-rail .sdk-form-msg:empty { display: none; }
}

/* =====================================================================================================
   Tutorial: the banner above the catalog, the buttons in "Cách chơi", and the in-game coach.
   ===================================================================================================== */
.sdk-tut-banner {
  display: flex; align-items: center; gap: 0.9rem;
  margin: 0 0 1.6rem; padding: 0.8rem 1rem;
  background: #e9d3a6; color: #2b2420; /* manila, like the case files below */
  border: 3px solid #000; box-shadow: 5px 5px 0 #000;
}
.sdk-tut-banner.is-done { background: #cdbb93; }
.sdk-tut-badge { display: grid; place-items: center; flex: 0 0 44px; height: 44px; background: var(--yellow); color: #000; border: 3px solid #000; font-size: 1.8rem; }
.sdk-tut-text { display: grid; gap: 0.15rem; flex: 1 1 auto; min-width: 0; }
.sdk-tut-text strong { font-size: 1.5rem; line-height: 1; }
.sdk-tut-text span { font-size: 1.1rem; line-height: 1.2; opacity: 0.85; }
.sdk-tut-banner .sdk-hero-btn { flex: 0 0 auto; }
@media (max-width: 520px) {
  .sdk-tut-banner { flex-wrap: wrap; }
  .sdk-tut-banner .sdk-hero-btn { width: 100%; }
}
.sdk-rules-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; margin-top: 1rem; }

/* the coach: everything else dimmed, a pulsing frame around one thing, a speech bubble beside it */
.sdk-coach { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
.sdk-coach[hidden] { display: none; }
.sdk-coach-spot {
  position: fixed; left: 0; top: 0; width: 0; height: 0;
  border: 3px solid var(--yellow);
  box-shadow: 0 0 0 200vmax rgba(5, 5, 9, 0.62), 0 0 18px 2px rgba(255, 218, 61, 0.55);
  transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease, opacity 0.2s ease;
  animation: sdk-coach-pulse 1.4s ease-in-out infinite;
}
@keyframes sdk-coach-pulse { 50% { border-color: #fff3b0; } }
.sdk-coach-bubble {
  position: fixed; left: 12px; top: 12px;
  pointer-events: auto;
  padding: 0.7rem 0.85rem 0.8rem;
  background: #f4ead2; color: #1d1a14;
  border: 3px solid #000; box-shadow: 5px 5px 0 #000;
  transition: left 0.25s ease, top 0.25s ease;
}
.sdk-coach-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.35rem; }
.sdk-coach-count { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.04em; color: #6b5f45; }
.sdk-coach-skip { background: none; border: 0; padding: 0.1rem 0.2rem; color: #6b5f45; font-size: 1rem; text-decoration: underline; cursor: pointer; }
.sdk-coach-text { margin: 0; font-size: 1.25rem; line-height: 1.25; }
.sdk-coach-warn { margin: 0.5rem 0 0; padding: 0.3rem 0.45rem; background: var(--red); color: var(--light); font-size: 1.05rem; line-height: 1.2; }
.sdk-coach-warn[hidden], .sdk-coach-next[hidden] { display: none; }
.sdk-coach-next { margin-top: 0.6rem; }
@media (max-width: 720px) {
  .sdk-coach-text { font-size: 1.1rem; }
  .sdk-coach-bubble { padding: 0.55rem 0.7rem 0.65rem; }
}
@media (prefers-reduced-motion: reduce) { .sdk-coach-spot, .sdk-coach-bubble { transition: none; animation: none; } }
/* the coach sits outside .sdk-main, so give it the game's pixel font explicitly */
.sdk-coach, .sdk-coach * { font-family: "VT323", ui-monospace, "Courier New", monospace !important; }

/* the solved board on the result card */
.sdk-result-map { width: min(260px, 64vw); margin: 0.6rem auto 0.4rem; padding: 0; box-shadow: 5px 5px 0 #000; transform: rotate(-1deg); }
.sdk-result-map svg { display: block; width: 100%; height: auto; image-rendering: pixelated; }
@media (max-height: 760px) { .sdk-result-map { width: min(200px, 52vw); } }

/* ---- people strip: a slider and edge fades when there are more people than fit ---- */
.sdk-picker-wrap { position: relative; min-width: 0; }
.sdk-picker-track { display: none; }
@media (max-width: 1100px) {
  .sdk-picker-wrap::before, .sdk-picker-wrap::after {
    content: '';
    position: absolute;
    top: 0.4rem; bottom: 22px;
    width: 34px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
  }
  .sdk-picker-wrap::before { left: 0; background: linear-gradient(90deg, #0a0a0a, rgba(10, 10, 10, 0)); }
  .sdk-picker-wrap::after { right: 0; background: linear-gradient(270deg, #0a0a0a, rgba(10, 10, 10, 0)); }
  .sdk-picker-wrap.more-before::before, .sdk-picker-wrap.more-after::after { opacity: 1; }
  .sdk-picker-wrap.is-scrollable .sdk-picker-track {
    display: block;
    position: relative;
    height: 8px;
    margin: 0.35rem 4px 0;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    touch-action: none;
    cursor: pointer;
  }
  /* a taller invisible hit area so the thin slider is easy to grab with a thumb */
  .sdk-picker-track::before { content: ''; position: absolute; inset: -10px 0; }
  .sdk-picker-track i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--yellow, #ffda3d); }
  .sdk-picker-wrap.is-scrollable .sdk-picker { padding-bottom: 0.3rem; }
}
/* the phone game screen lists suspects as cards instead of the strip */
/* ---- Phone game screen, part 2: the cast strip and the clue card (option A) ----------------------- */
.sdk-cluecard { display: none; }
/* tiles a "Nhắc tới" chip points at: dashed frame + the furniture bobs, for a couple of seconds */
.sdk-cell.is-spot .sdk-glow { outline: 3px dashed var(--yellow); outline-offset: -5px; animation: sdk-spot 0.45s steps(2) 4; }
.sdk-cell.is-spot .sdk-feature { animation: sdk-bob 0.9s steps(2) infinite; }
@keyframes sdk-spot { 50% { background-color: rgba(255, 218, 61, 0.35); } }

@media (max-width: 720px) {
  /* the whole cast in one row: every portrait the same width, no scrolling */
  body.sdk-in-game .sdk-picker-wrap { grid-area: picker; margin: 0; }
  body.sdk-in-game .sdk-picker-wrap::before,
  body.sdk-in-game .sdk-picker-wrap::after,
  body.sdk-in-game .sdk-picker-track { display: none !important; }
  body.sdk-in-game .sdk-picker {
    display: grid !important;
    grid-template-columns: repeat(var(--np, 6), minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    padding: 4px 0 0;
  }
  body.sdk-in-game .sdk-pick {
    position: relative;
    flex-direction: column;
    gap: 1px;
    min-height: 0;
    min-width: 0;
    padding: 3px 1px 2px;
    background: var(--pc-light, var(--paper));
    color: var(--ink);
    border: 2px solid var(--ink);
    box-shadow: none;
    font-size: 0.85rem;
    line-height: 1;
  }
  body.sdk-in-game .sdk-pick .sdk-token { width: min(32px, 100%); border-width: 0; }
  body.sdk-in-game .sdk-pick span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.sdk-in-game .sdk-pick.is-placed { opacity: 0.45; }
  body.sdk-in-game .sdk-pick.is-placed::after,
  body.sdk-in-game .sdk-pick.is-victim::after {
    position: absolute; top: 1px; right: 1px;
    display: grid; place-items: center; width: 13px; height: 13px;
    color: var(--ink); font-size: 0.75rem; line-height: 1;
  }
  body.sdk-in-game .sdk-pick.is-placed::after { content: '✓'; background: var(--green); }
  body.sdk-in-game .sdk-pick.is-victim::after { content: '†'; background: var(--red); }
  body.sdk-in-game .sdk-pick.is-selected { opacity: 1; background: var(--pc-light, var(--yellow)); border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow), 3px 3px 0 var(--yellow); transform: translateY(-2px); }

  /* the clue card */
  body.sdk-in-game .sdk-cluecard {
    grid-area: card;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #111;
    color: var(--light);
    border: 2px solid #333;
    box-shadow: 4px 4px 0 var(--ink);
    touch-action: pan-y;
    overflow: hidden;
  }
  body.sdk-in-game .sdk-cluecard.is-person { border-color: var(--yellow); }
  .sdk-cluecard-head { display: flex; align-items: center; gap: 0.55rem; padding: 0.35rem 0.6rem 0.35rem 0.45rem; background: var(--pc-light, #ddd); color: var(--ink); flex: 0 0 auto; }
  .sdk-cluecard-head .sdk-token { width: 44px; flex: 0 0 44px; margin: 0; }
  .sdk-cluecard-who { display: grid; gap: 0.1rem; min-width: 0; flex: 1 1 auto; }
  .sdk-cluecard-who strong { font-size: 1.6rem; line-height: 1; }
  .sdk-cluecard-who small { font-size: 1rem; line-height: 1; color: rgba(0, 0, 0, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sdk-cluecard-count { font-size: 1.1rem; color: rgba(0, 0, 0, 0.55); flex: 0 0 auto; }
  .sdk-cluecard.is-placed .sdk-cluecard-head { filter: saturate(0.6); }
  .sdk-cluecard-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.6rem 0.7rem 0.5rem; display: grid; align-content: start; gap: 0.6rem; }
  .sdk-cluecard-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
  .sdk-cluecard-list li { position: relative; padding-left: 1rem; font-size: 1.3rem; line-height: 1.15; }
  .sdk-cluecard-list li::before { content: '▸'; position: absolute; left: 0; color: var(--yellow); }
  .sdk-cluecard-list li.sdk-rule { color: #e0605a; }
  .sdk-cluecard-title { font-size: 1.45rem; line-height: 1.05; color: var(--light); }
  .sdk-cluecard.is-mark .sdk-cluecard-title { color: var(--yellow); }
  .sdk-cluecard.is-status .sdk-cluecard-hint { margin: 0; font-size: 1.1rem; line-height: 1.2; color: var(--muted); }
  .sdk-cluecard-general h4 { margin: 0 0 0.25rem; font-size: 1rem; color: var(--muted); font-weight: normal; text-transform: uppercase; letter-spacing: 0.04em; }

  /* "Nhắc tới": people, furniture and rooms the clues name */
  .sdk-mentions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.4rem; }
  .sdk-mentions-label { font-size: 1.05rem; color: var(--muted); }
  .sdk-mention { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 30px; padding: 0.1rem 0.5rem 0.1rem 0.2rem; background: var(--panel); color: var(--light); border: 1px solid #3a3a3a; font-size: 1.1rem; line-height: 1; cursor: pointer; }
  .sdk-mention:active { background: var(--yellow); color: var(--ink); }
  .sdk-mention .sdk-token { width: 22px; flex: 0 0 22px; border-width: 1px; box-shadow: none; margin: 0; }
  .sdk-mention-icon { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; }
  .sdk-mention-icon svg { width: 22px; height: 22px; image-rendering: pixelated; }
  .sdk-mention.is-room .sdk-mention-icon { background: #333; color: var(--yellow); font-size: 1rem; }

  /* bottom of the card: previous / what to do / next */
  .sdk-cluecard-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; padding: 0.25rem 0.4rem; background: #1a1a1a; border-top: 1px solid #2a2a2a; flex: 0 0 auto; }
  .sdk-cluecard-step { flex: 0 0 auto; min-height: 32px; padding: 0 0.35rem; background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
  .sdk-cluecard-step:active { color: var(--yellow); }
  .sdk-cluecard-nav .sdk-cluecard-hint { flex: 1 1 auto; min-width: 0; text-align: center; font-size: 0.95rem; line-height: 1.1; color: #7d786f; }
}
/* short phones (iPhone SE and the like): a slimmer card head so two clues still fit */
@media (max-width: 720px) and (max-height: 720px) {
  .sdk-cluecard-head { padding-top: 0.2rem; padding-bottom: 0.2rem; }
  .sdk-cluecard-head .sdk-token { width: 32px; flex-basis: 32px; }
  .sdk-cluecard-who strong { font-size: 1.3rem; }
  .sdk-cluecard-body { padding-top: 0.4rem; gap: 0.4rem; }
  .sdk-cluecard-list li { font-size: 1.2rem; }
  .sdk-cluecard-nav .sdk-cluecard-hint { display: none; }
  .sdk-cluecard-step { min-height: 28px; }
}

/* ---- Phones: drag a portrait onto the board -------------------------------------------------------- */
@media (max-width: 720px) {
  /* the finger drags, the page must not pan (the game screen never scrolls anyway) */
  body.sdk-in-game .sdk-pick,
  body.sdk-in-game .sdk-cell { touch-action: none; -webkit-touch-callout: none; }
}
body.sdk-dragging, body.sdk-dragging * { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.sdk-drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 1000;
  pointer-events: none;
  filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, 0.75));
  animation: sdk-lift 0.12s steps(2) both;
}
.sdk-drag-ghost .sdk-token { width: 100%; max-width: none; margin: 0; border: 3px solid var(--yellow); box-shadow: none; }
@keyframes sdk-lift { from { opacity: 0.4; } }
/* where it came from: an empty dashed slot in the strip, a faded token on the board */
.sdk-pick.is-drag-source { background: transparent !important; border: 2px dashed var(--yellow) !important; box-shadow: none !important; transform: none !important; }
.sdk-pick.is-drag-source > * { visibility: hidden; }
.sdk-token.is-drag-source { opacity: 0.25; }
/* the square under the finger, its row and its column */
/* (board-qualified so they win over the clue glow that dims the rest of the board) */
.sdk-board .sdk-cell.is-drop .sdk-glow { background-color: rgba(255, 218, 61, 0.55); outline: 3px solid var(--yellow); outline-offset: -3px; }
.sdk-board .sdk-cell.is-drop-line .sdk-glow { background-color: rgba(255, 218, 61, 0.3); }
.sdk-board .sdk-cell.is-drop-bad .sdk-glow { background-color: rgba(200, 66, 58, 0.4); outline: 3px solid var(--red); outline-offset: -3px; }
.sdk-drag-toast {
  position: fixed; z-index: 999; transform: translate(-50%, -100%);
  max-width: calc(100vw - 32px); padding: 0.3rem 0.7rem;
  background: var(--ink); color: var(--light); border: 2px solid var(--yellow);
  font-family: var(--pixel-font); font-size: 1.05rem; line-height: 1.1; white-space: nowrap;
  pointer-events: none;
}
.sdk-drag-toast.is-off { border-color: var(--muted); color: var(--muted); }

/* ---- Room names: centred along the room's bottom row (all screen sizes) ------------------------------ */
/* roomLabelSpots() picks the bottom row's longest stretch; fitRoomLabels() sets the exact width. */
.sdk-board .sdk-room-label {
  top: auto;
  bottom: 1px;
  max-width: none;
  text-align: center;
  white-space: normal;
  overflow-wrap: normal;
  word-break: keep-all; /* break between words only: "PHÒNG ĂN", never "PHÒN|G ĂN" */
  padding: 0 2px;
}
@media (max-width: 720px) {
  .sdk-board .sdk-room-label { font-size: 0.95rem; line-height: 1; letter-spacing: 0; }
}

/* ---- Room names: see-through outlined text, no black box --------------------------------------------- */
/* White letters with a black outline (8 hard shadows = a pixel stroke that keeps the accents crisp), so the
   floor shows between the letters. Pointing at a room turns its name yellow. */
.sdk-board .sdk-room-label {
  background: transparent;
  box-shadow: none;
  color: #fff;
  text-shadow:
    -2px -2px 0 #000, 0 -2px 0 #000, 2px -2px 0 #000,
    -2px 0 0 #000, 2px 0 0 #000,
    -2px 2px 0 #000, 0 2px 0 #000, 2px 2px 0 #000,
    3px 3px 0 rgba(0, 0, 0, 0.55);
}
.sdk-board .sdk-cell.is-room-hover .sdk-room-label { background: transparent; box-shadow: none; color: var(--yellow); }
@media (max-width: 720px) {
  .sdk-board .sdk-room-label {
    text-shadow:
      -1.5px -1.5px 0 #000, 0 -1.5px 0 #000, 1.5px -1.5px 0 #000,
      -1.5px 0 0 #000, 1.5px 0 0 #000,
      -1.5px 1.5px 0 #000, 0 1.5px 0 #000, 1.5px 1.5px 0 #000;
  }
}

/* ---- Room names always on top ---------------------------------------------------------------------- */
/* A name may span several squares, so a portrait (z 4), a hovered square (5), a focused or lit room (6)
   must never paint over it: the square holding the name sits above all of those, and the name above
   everything inside it. Only the brief placing animation (.is-flying, 8) passes over it. The name never
   takes taps (pointer-events: none), so the people under it stay easy to grab. */
.sdk-board .sdk-cell.has-room-label { z-index: 7; }
.sdk-board .sdk-cell .sdk-room-label,
.sdk-board .sdk-cell.is-room-hover .sdk-room-label { z-index: 9; }

/* ---- Drag on every screen size: cursors and the desktop card left behind --------------------------- */
@media (hover: hover) and (pointer: fine) {
  .sdk-person, .sdk-pick, .sdk-cell .sdk-token { cursor: grab; }
}
.sdk-person.is-drag-source { opacity: 1; background: transparent !important; outline: 2px dashed var(--yellow); outline-offset: -2px; box-shadow: none !important; }
.sdk-person.is-drag-source > * { opacity: 0.25; }

/* Room names: no colour swatch in front of the name (left over from the black-box tags) */
.sdk-board .sdk-room-label::before { content: none; display: none; }
