/* Free web puzzles: pages, boards, keyboard, results. */

.crumb { font-size: 14px; font-weight: 700; color: var(--faint); margin: 0 0 8px; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.puzzle-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.puzzle-head h1 { font-size: clamp(38px, 6vw, 62px); letter-spacing: -.045em; display: flex; align-items: center; gap: 14px; }
.puzzle-head h1 img { width: 56px; height: 56px; border-radius: 24%; box-shadow: var(--shadow); }
.puzzle-head .lede { margin-top: 8px; }
@media (min-width: 700px) { .puzzle-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
/* Phones: keep the board and its controls on one screen. */
@media (max-width: 600px) {
  body:has(.play-root) .site-nav { display: none; }
  body:has(.play-root) .nav-shell { padding-top: 10px; padding-bottom: 4px; }
  .crumb { font-size: 13px; margin-bottom: 2px; }
  .puzzle-head { gap: 10px; }
  .puzzle-head h1 { font-size: 30px; gap: 10px; }
  .puzzle-head h1 img { width: 40px; height: 40px; }
  .puzzle-head .lede { font-size: 14.5px; margin-top: 4px; }
  .levels .level { font-size: 14px; padding: 6px 14px; }
  .play { margin-top: 14px; }
  .wg { width: min(100%, 330px, max(220px, calc((100dvh - 480px) * .85))); }
}

.levels { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 253, 248, .85); box-shadow: var(--shadow); }
.levels .level { text-decoration: none; font-weight: 800; font-size: 15px; padding: 8px 16px; border-radius: 999px; color: #50575c; }
.levels .level.on { background: var(--cta); color: var(--cta-ink); }

.friend-banner { margin: 18px 0 0; padding: 12px 16px; border-radius: 16px; background: var(--sun); border: 2px solid var(--sun-line); font-weight: 800; }

.play { display: grid; gap: 22px; margin-top: 22px; align-items: start; }
@media (min-width: 980px) { .play { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 34px; } }
.play-card { padding: clamp(14px, 3vw, 22px); border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); }
.play-card.lilac { background: var(--lilac); }
.play-card.mint { background: #eef6ee; }
.play-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; font-size: 15px; color: #3d4246; margin-bottom: 12px; }
.play-bar .timer { font-variant-numeric: tabular-nums; }
.play-bar .status { color: var(--muted); font-weight: 700; text-align: right; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tool { border: 0; cursor: pointer; min-height: 44px; padding: 0 14px; border-radius: 13px; background: rgba(255, 255, 255, .85); box-shadow: var(--shadow); font-weight: 800; font-size: 14.5px; }
.tool.on, .tool[aria-pressed="true"] { background: var(--ink); color: #fff; }
/* One even row of tools for the puzzles that use plain tool buttons. */
.play-root:is([data-chalk-game="sudoku"], [data-chalk-game="twin-flow"], [data-chalk-game="sun-moon"]) .tools { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.play-root:is([data-chalk-game="sudoku"], [data-chalk-game="twin-flow"], [data-chalk-game="sun-moon"]) .tool { padding: 0 6px; white-space: nowrap; }
@media (max-width: 380px) { .play-root .tool { font-size: 13.5px; } }
.side { display: grid; gap: 16px; }
.side .box { padding: 20px 22px; }
.side h2 { font-size: 21px; margin-bottom: 8px; }
.side ol, .side ul { margin: 0; padding-left: 20px; font-weight: 600; color: #3a3f43; }
.side li { margin-bottom: 6px; }
.app-card { padding: 20px 22px; border-radius: 22px; background: var(--sun); border: 2px solid var(--sun-line); }
.app-card .top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.app-card .top img { width: 38px; }
.app-card h2 { font-size: 20px; margin: 0; }
.app-card p { margin: 0 0 14px; font-weight: 600; color: #4b4321; font-size: 15px; }
noscript p { padding: 16px; border-radius: 16px; background: var(--sun); font-weight: 700; }

.days { display: flex; gap: 6px; }
.days .day { flex: 1; min-width: 0; text-align: center; text-decoration: none; padding: 8px 0; border-radius: 14px; background: var(--cream); font-size: 12px; font-weight: 700; color: var(--muted); }
.days .day b { display: block; font-size: 16px; color: var(--ink); }
.days .day.on { background: var(--cta); color: var(--cta-ink); }
.days .day.solved { box-shadow: inset 0 -4px 0 var(--green); }

/* ---------- Sudoku */
.sdk { display: grid; width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; background: #fff; touch-action: manipulation; }
.sdk-row { display: grid; grid-template-columns: repeat(9, 1fr); }
.sdk-cell { position: relative; border: 0; margin: 0; padding: 0; background: transparent; border-right: 1px solid rgba(23, 27, 30, .16); border-bottom: 1px solid rgba(23, 27, 30, .16); display: grid; place-items: center; cursor: pointer; font-size: clamp(17px, 4.6vw, 26px); font-weight: 600; color: var(--ink); line-height: 1; }
.sdk-row:last-child .sdk-cell { border-bottom: 0; }
.sdk-cell:last-child { border-right: 0; }
.sdk-cell.br { border-right: 2.5px solid var(--ink); }
.sdk-cell.bb { border-bottom: 2.5px solid var(--ink); }
.sdk-cell.given { font-weight: 800; }
.sdk-cell.user { color: var(--purple); }
.sdk-cell.peer { background: rgba(248, 206, 70, .14); }
.sdk-cell.same { background: rgba(122, 87, 209, .14); }
.sdk-cell.sel { background: rgba(248, 206, 70, .62); }
.sdk-cell.bad { color: var(--danger); background: rgba(180, 55, 47, .12); }
.sdk-cell:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; border-radius: 0; }
.sdk-cell .notes { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); font-size: clamp(8px, 1.9vw, 11px); font-weight: 700; color: #6f6a5b; }
.sdk-cell .notes i { font-style: normal; display: grid; place-items: center; visibility: hidden; }
.sdk-cell .notes i.on { visibility: visible; }
.sdk.solved { border-color: var(--green); }
.pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; max-width: 520px; margin: 14px auto 0; }
.pad-key { border: 0; cursor: pointer; aspect-ratio: 1 / 1.15; border-radius: 12px; background: #fff; box-shadow: var(--shadow); font-weight: 800; font-size: clamp(17px, 4.4vw, 22px); }
.pad-key.done { opacity: .35; }

/* ---------- Twin Flow */
.tf { position: relative; width: 100%; max-width: 480px; margin: 0 auto; aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; border-radius: 16px; }
.tf svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tf .cell { fill: #efece4; }
.tf .pipe { fill: none; stroke-width: .3; stroke-linecap: round; stroke-linejoin: round; }
.tf .dot { stroke: rgba(0, 0, 0, .12); stroke-width: .03; }
.tf .dot-l { font-family: var(--font); font-size: .34px; font-weight: 800; fill: #fff; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.tf .dot-l.dark { fill: var(--ink); }
.tf .kbd-cursor { fill: none; stroke: var(--ink); stroke-width: .05; opacity: 0; }
.tf.kbd .kbd-cursor, .tf:focus-visible .kbd-cursor { opacity: 1; }
.tf:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.tf.solved .cell { fill: #e7f3ea; }

/* ---------- Word Guess */
.wg { display: grid; gap: 7px; width: min(100%, 330px); margin: 0 auto; }
.wg-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.wg-tile { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; border: 2px solid #d9d3c3; background: rgba(255, 255, 255, .6); font-size: clamp(22px, 6vw, 30px); font-weight: 800; text-transform: uppercase; }
.wg-tile.typed { border-color: var(--ink); background: #fff; }
.wg-tile.G, .wg-tile.Y, .wg-tile.X { color: #fff; border-color: transparent; }
.wg-tile.G { background: var(--green); }
.wg-tile.Y { background: #c78614; }
.wg-tile.X { background: #7d8388; }
.wg-tile.G::after, .wg-tile.Y::after, .wg-tile.X::after { position: absolute; right: 4px; top: 2px; font-size: 11px; font-weight: 800; opacity: .9; }
.wg-tile.G::after { content: "✓"; }
.wg-tile.Y::after { content: "•"; }
.wg-tile.X::after { content: "×"; }
.wg-row.shake { animation: shake .36s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.keys { display: grid; gap: 6px; margin: 16px auto 0; max-width: 500px; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.kb-key { flex: 1 1 0; min-width: 0; max-width: 46px; height: 52px; border: 0; cursor: pointer; border-radius: 9px; background: #e7e1d0; font-weight: 800; font-size: 15px; }
.kb-key.wide { max-width: 72px; flex: 1.55 1 0; font-size: 12px; letter-spacing: -.01em; padding: 0 2px; }
@media (max-width: 380px) { .kb-key { height: 48px; font-size: 14px; } .kb-key.wide { font-size: 10.5px; } }
.kb-key.G, .kb-key.Y, .kb-key.X { color: #fff; }
.kb-key.G { background: var(--green); }
.kb-key.Y { background: #c78614; }
.kb-key.X { background: #7d8388; }
.clue { margin: 14px auto 0; max-width: 500px; padding: 12px 14px; border-radius: 14px; background: var(--sun); font-weight: 700; }

/* ---------- hub */
.set-grid { display: grid; gap: 16px; }
@media (min-width: 820px) { .set-grid { grid-template-columns: repeat(3, 1fr); } }
.more-covers { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.more-covers figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 90px; text-align: center; }
.more-covers figcaption { font-size: 13px; font-weight: 700; color: #4a5054; line-height: 1.2; }

/* ---------- result sheet + toast */
dialog.result { border: 0; padding: 0; background: transparent; max-width: min(440px, calc(100% - 24px)); width: 100%; }
dialog.result::backdrop { background: rgba(23, 27, 30, .45); }
.result-box { position: relative; background: var(--paper); border-radius: 28px; padding: 26px 22px 22px; box-shadow: var(--shadow-lg); display: grid; gap: 10px; }
.result-box h2 { font-size: 34px; letter-spacing: -.035em; }
.result-box .eyebrow { margin: 0; }
.result-stat { margin: 0; font-weight: 800; font-size: 18px; }
.result-beat { margin: 0; padding: 10px 12px; border-radius: 14px; background: var(--cream); font-weight: 700; }
.result-beat.good { background: var(--mint); color: #17603f; }
.result-actions { display: grid; gap: 8px; margin-top: 6px; }
.result-app { display: flex; align-items: center; gap: 12px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }
.result-app p { margin: 0; font-weight: 700; font-size: 14.5px; }
.result-app img { width: 36px; flex: none; }
.result-box .stores { margin-top: 4px; }
.result-box .store-button { min-height: 50px; }
.result-close { position: absolute; right: 12px; top: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--cream); cursor: pointer; font-size: 22px; font-weight: 700; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 22px; transform: translate(-50%, 140%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 800; box-shadow: var(--shadow-lg); transition: transform .2s ease; width: max-content; max-width: calc(100% - 24px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }

/* hero puzzle on the home page */
.hero-puzzle { padding: 18px 20px 20px; border-radius: 30px; background: var(--lilac); box-shadow: var(--shadow-lg); }
.hero-puzzle .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-puzzle .title { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.hero-puzzle .title img { width: 42px; height: 42px; border-radius: 24%; }
.hero-puzzle .title b { display: block; font-size: 22px; letter-spacing: -.02em; }
.hero-puzzle .title span { font-size: 14px; font-weight: 600; color: var(--muted); }
.hero-puzzle .tf { max-width: 400px; }
.hero-puzzle .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; font-weight: 800; font-size: 14px; color: #3d4246; flex-wrap: wrap; }
.hero-puzzle .tools { margin-top: 0; }
.hero-puzzle .tool { min-height: 38px; font-size: 13.5px; padding: 0 12px; }
