/* InSnip Play, the game mode shell every game shares. The page tokens (--bg, --ink, --gold and
   friends) are set inline by each Function. html.gm sends the site header and the static how it
   works text away; html.gm-play also fixes the game screen to the visible height, so nothing
   scrolls while a game is on. One off-white filled button per screen; gold is a game state and
   an accent, never a filled button. One entrance (ease-out-quart), none when asked for less. */

:root {
  --gm-bar: 52px;
  --gm-quart: cubic-bezier(0.25, 1, 0.5, 1);
  /* the kit (/play/kit.js): motion curves and the tactile depth every game can opt into */
  --gm-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --kt-press-ms: 80ms;
  --kt-edge: 3px;
  --kt-edge-c: rgba(0, 0, 0, 0.5);
  --kt-face: #1b1b1f;
  --kt-face-hi: #232328;
  --kt-gold-edge: #a8843a;
  /* the board's size: games size their board with var(--gm-board) and their column with var(--gm-col) */
  --gm-col: 600px;
  --gm-board: min(calc(100vw - 32px), 560px);
}
/* a wide screen with the height for it: a game that adds class gm-wide to <html> gets a wider column
   and a bigger board (size the board with var(--gm-board), the column with var(--gm-col)) */
@media (min-width: 900px) and (min-height: 700px) {
  html.gm-wide { --gm-col: 760px; --gm-board: min(78vh, 680px); }
}

/* ---- game mode ---- */
html.gm .site-nav, html.gm [data-gm-hide] { display: none !important; }
html.gm-play .site-foot { display: none !important; }
html.gm, html.gm body { overscroll-behavior-y: none; }
html.gm-play, html.gm-play body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.gm-play .gm-screen {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 30;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  background: var(--bg);
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
html.gm-play.gm-vv .gm-screen { top: var(--gm-top, 0px); height: var(--gm-h, 100dvh); }
html.gm-play .gm-screen button, html.gm-play .gm-screen [role="button"] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.gm-screen button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ---- the bar ---- */
.gm-bar { flex: none; display: grid; grid-template-columns: minmax(44px, 1fr) minmax(0, auto) minmax(max-content, 1fr); align-items: center; width: 100%; max-width: var(--gm-col, 600px); height: var(--gm-bar); margin: 0 auto; padding: 0 4px 0 2px; }
html.gm .gm-bar { border-bottom: 1px solid var(--line); }
html.gm:not(.gm-play) .gm-bar { position: sticky; top: 0; z-index: 20; max-width: none; padding-left: max(2px, calc((100% - var(--gm-col, 600px)) / 2 + 2px)); padding-right: max(4px, calc((100% - var(--gm-col, 600px)) / 2 + 4px)); background: var(--bg); }
.gm-back { justify-self: start; display: inline-flex; align-items: center; gap: 0; min-width: 44px; min-height: 44px; padding: 0 10px 0 4px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; cursor: pointer; transition: color 160ms var(--ease); }
.gm-back:hover { color: var(--ink); }
.gm-name { min-width: 0; margin: 0; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.15; letter-spacing: -0.005em; white-space: nowrap; }
.gm-tools { justify-self: end; display: inline-flex; }
.gm-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); cursor: pointer; transition: color 160ms var(--ease), background-color 160ms var(--ease); }
.gm-icon:hover { color: var(--ink); background: rgba(241, 239, 233, 0.06); }
.gm-icon:active { transform: scale(0.94); }
@media (max-width: 380px) {
  .gm-icon { width: 44px; }
  .gm-back span { display: none; }
  .gm-back { padding: 0 8px; }
  .gm-name { font-size: 21px; }
}
@media (max-width: 340px) {
  .gm-bar { padding: 0 2px 0 0; }
  .gm-icon { width: 44px; }
  .gm-name { padding: 0 2px; font-size: 20px; }
}

/* ---- the toast ---- */
.gm-toast { position: fixed; left: 50%; top: calc(var(--gm-top, 0px) + env(safe-area-inset-top) + var(--gm-bar) + var(--gm-toast-y, 12px)); z-index: 80; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 12px; border: 1px solid rgba(241, 239, 233, 0.14); background: #26262b; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.8); color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.35; text-align: center; opacity: 0; transform: translate(-50%, -6px); pointer-events: none; transition: opacity 180ms var(--gm-quart), transform 220ms var(--gm-quart); }
.gm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
html:not(.gm) .gm-toast { top: calc(env(safe-area-inset-top) + 16px); }

/* ---- buttons ---- */
.gm-primary, .gm-quiet { text-decoration: none; }
.gm-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 26px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: opacity 160ms var(--ease), transform 120ms var(--ease); touch-action: manipulation; }
.gm-primary:hover { opacity: 0.92; }
.gm-primary:active { transform: scale(0.98); }
.gm-quiet { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid rgba(241, 239, 233, 0.3); background: transparent; color: var(--ink); font: inherit; font-size: 15.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: border-color 160ms var(--ease); touch-action: manipulation; }
.gm-quiet:hover { border-color: rgba(241, 239, 233, 0.6); }
.gm-text { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(241, 239, 233, 0.25); text-underline-offset: 4px; }
.gm-text:hover { color: var(--ink); }

/* ---- the result, the same order in every game ---- */
.gm-result { padding: 28px 0 8px; }
.gm-verdict { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; }
.gm-verdict:focus { outline: none; }
.gm-sub { margin: 6px 0 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.gm-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 20px 0 0; }
.gm-acts > .gm-primary { flex: 1 1 200px; }
.gm-acts > .gm-quiet { flex: 0 1 auto; }
.gm-fine { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.gm-block { margin: 24px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); }
.gm-count { margin: 18px 0 0; font-size: 15px; color: var(--muted); }
.gm-count-t { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.gm-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.gm-fig { display: grid; justify-items: center; gap: 2px; text-align: center; }
.gm-fig strong { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.gm-fig span { font-size: 12.5px; line-height: 1.3; color: var(--muted); }

.gm-next { margin: 26px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); }
.gm-next-h { margin: 0 0 4px; font-family: var(--serif); font-weight: 400; font-size: 20px; }
.gm-next ul { list-style: none; margin: 0; padding: 0; }
.gm-next-a { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.gm-next-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.gm-next-t strong { font-weight: 600; font-size: 16px; color: var(--ink); transition: color 160ms var(--ease); }
.gm-next-t span { font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.gm-next-s { flex: none; min-width: 58px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(241, 239, 233, 0.26); font-size: 13.5px; font-weight: 600; text-align: center; color: var(--ink); }
.gm-next-s.is-done { border-color: transparent; color: var(--muted); }
.gm-next-a:hover .gm-next-t strong { color: var(--gold); }

/* ---- the sheet ---- */
html.gm-locked, html.gm-locked body { overflow: hidden; }
.gm-scrim { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(6, 6, 8, 0.66); }
.gm-sheet { position: relative; width: 100%; max-width: 480px; max-height: min(92dvh, 760px); overflow: auto; overscroll-behavior: contain; padding: 6px 20px max(20px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: 0; background: #131316; box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.8); }
.gm-sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 6px; background: #131316; }
.gm-sheet-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.2; }
.gm-sheet-head h2:focus { outline: none; }
.gm-close { margin-right: -10px; }
.gm-sheet-body { font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.gm-sheet-body p { margin: 0 0 12px; }
.gm-sheet-acts { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: center; margin: 18px 0 2px; }
.gm-sheet-acts .gm-primary { flex: 1 1 100%; }
@media (min-width: 600px) {
  .gm-scrim { align-items: center; padding: 24px; }
  .gm-sheet { border-radius: 22px; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
}

/* settings rows: a switch drawn from a checkbox */
.gm-set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.gm-set-row label { display: grid; gap: 2px; cursor: pointer; }
.gm-set-row strong { font-size: 16px; font-weight: 600; color: var(--ink); }
.gm-set-row span { font-size: 14px; line-height: 1.45; color: var(--muted); }
.gm-set-row input { flex: none; position: relative; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: #2d2d33; box-shadow: inset 0 0 0 1px rgba(241, 239, 233, 0.16); cursor: pointer; appearance: none; -webkit-appearance: none; transition: background-color 180ms var(--ease); }
.gm-set-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink-2); transition: transform 200ms var(--gm-quart), background-color 180ms var(--ease); }
.gm-set-row input:checked { background: rgba(232, 193, 105, 0.32); box-shadow: inset 0 0 0 1px var(--gold); }
.gm-set-row input:checked::after { transform: translateX(18px); background: var(--gold); }

/* ---- motion ---- */
@media (prefers-reduced-motion: no-preference) {
  .gm-enter { animation: gm-enter 340ms var(--gm-quart) both; }
  .gm-scrim { animation: gm-fade 180ms var(--ease) both; }
  .gm-sheet { animation: gm-up 280ms var(--gm-quart) both; }
  .gm-scrim.is-out { animation: gm-fade 160ms var(--ease) reverse both; }
}
@keyframes gm-enter { from { opacity: 0; transform: translateY(10px); } }
@keyframes gm-fade { from { opacity: 0; } }
@keyframes gm-up { from { transform: translateY(28px); opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  .gm-toast, .gm-set-row input, .gm-set-row input::after { transition: none; }
}

/* ===================================================================================
   THE KIT (/play/kit.js): the "real game" layer every game shares. Tokens are on :root above.
   Opt in by class; nothing here changes a game that does not use it.
   =================================================================================== */

/* ---- tactile pieces: a darker bottom edge, pressed down under the finger ---- */
.kt-key, .kt-depth { transition: transform var(--kt-press-ms) var(--gm-quart), box-shadow var(--kt-press-ms) var(--gm-quart), background-color 160ms var(--ease), border-color 160ms var(--ease); }
.kt-key { position: relative; background: var(--kt-face); border-radius: 12px; box-shadow: 0 var(--kt-edge) 0 var(--kt-edge-c), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.kt-depth { box-shadow: 0 var(--kt-edge) 0 var(--kt-edge-c); }
.gm-primary.kt-depth { box-shadow: 0 var(--kt-edge) 0 #9d998f; }
.kt-key:hover:not([disabled]) { background: var(--kt-face-hi); }
.kt-key:active:not([disabled]), .kt-key.is-down, .kt-depth:active:not([disabled]), .kt-depth.is-down { transform: translateY(2px); box-shadow: 0 1px 0 var(--kt-edge-c), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.gm-primary.kt-depth:active:not([disabled]), .gm-primary.kt-depth.is-down { box-shadow: 0 1px 0 #9d998f; }
.kt-key.is-gold { background: var(--gold); color: #141210; box-shadow: 0 var(--kt-edge) 0 var(--kt-gold-edge); }

/* pop on place, shake on invalid, settle in, the hint glow. They animate the scale and translate
   properties, not transform, so a game's own transforms (tile positions) are left alone. */
@media (prefers-reduced-motion: no-preference) {
  .kt-pop { animation: kt-pop 200ms var(--gm-expo); }
  .kt-shake { animation: kt-shake 360ms var(--gm-quart); }
  .kt-settle { animation: kt-settle 280ms var(--gm-quart) both; }
  .kt-glow { animation: kt-glow 1.8s ease-in-out infinite; }
}
.kt-glow { box-shadow: 0 0 0 2px rgba(232, 193, 105, 0.85), 0 0 18px -2px rgba(232, 193, 105, 0.55); }
@keyframes kt-pop { from { scale: var(--kt-pop, 1.14); } to { scale: 1; } }
@keyframes kt-shake { 0%, 100% { translate: 0 0; } 18% { translate: -7px 0; } 38% { translate: 6px 0; } 58% { translate: -4px 0; } 78% { translate: 2px 0; } }
@keyframes kt-settle { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }
@keyframes kt-glow { 0%, 100% { box-shadow: 0 0 0 2px rgba(232, 193, 105, 0.85), 0 0 18px -2px rgba(232, 193, 105, 0.55); } 50% { box-shadow: 0 0 0 2px rgba(232, 193, 105, 0.45), 0 0 6px -2px rgba(232, 193, 105, 0.2); } }
.kt-stuck { margin: 0; font-size: 15px; font-weight: 600; color: var(--gold); text-align: center; }

/* ---- emblems: gold line marks, drawn on once ---- */
.kt-emb { display: block; flex: none; overflow: visible; }
.kt-gold { color: var(--gold); }
@media (prefers-reduced-motion: no-preference) {
  .kt-emb.is-draw .e { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: kt-draw 900ms var(--gm-quart) forwards; }
  .kt-emb.is-draw .e:nth-child(2) { animation-delay: 70ms; }
  .kt-emb.is-draw .e:nth-child(3) { animation-delay: 140ms; }
  .kt-emb.is-draw .e:nth-child(4) { animation-delay: 210ms; }
  .kt-emb.is-draw .e:nth-child(n + 5) { animation-delay: 260ms; }
  .kt-emb.is-draw .f { opacity: 0; animation: kt-show 420ms 560ms var(--gm-quart) forwards; }
}
@keyframes kt-draw { to { stroke-dashoffset: 0; } }
@keyframes kt-show { to { opacity: 1; } }

/* ---- the start card ---- */
.kt-start { position: fixed; left: 0; right: 0; top: calc(var(--gm-top, 0px) + env(safe-area-inset-top) + var(--gm-bar)); bottom: 0; z-index: 40; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px max(18px, env(safe-area-inset-bottom)); background: var(--bg); }
html.gm-play.gm-vv .kt-start { bottom: auto; height: calc(var(--gm-h) - env(safe-area-inset-top) - var(--gm-bar)); }
.kt-start.is-flow { position: relative; top: auto; left: auto; right: auto; bottom: auto; height: auto; z-index: auto; flex: 1 1 auto; min-height: 0; }
.kt-start.is-out { opacity: 0; transition: opacity 180ms var(--gm-quart); pointer-events: none; }
.kt-start-in { width: 100%; max-width: 440px; margin: auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
.kt-start-emb { color: var(--gold); margin: 0 0 18px; }
.kt-start-name { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(46px, 13vw, 72px); line-height: 1.04; letter-spacing: -0.02em; }
.kt-start-name:focus { outline: none; }
.kt-start-meta { margin: 10px 0 0; font-size: 16px; color: var(--ink-2); font-variant-numeric: lining-nums; }
.kt-diff { display: inline-flex; align-items: center; gap: 10px; margin: 16px 0 0; padding: 8px 15px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; line-height: 1.3; color: var(--ink-2); }
.kt-pips { display: inline-flex; gap: 4px; }
.kt-pips i { width: 7px; height: 7px; border-radius: 50%; background: rgba(241, 239, 233, 0.18); }
.kt-pips i.on { background: var(--gold); }
.kt-start-promise { margin: 20px 0 0; max-width: 32ch; font-size: 17px; line-height: 1.5; color: var(--ink-2); text-wrap: balance; }
.kt-chal { margin: 20px 0 0; max-width: 36ch; padding: 12px 18px; border-radius: 14px; background: rgba(232, 193, 105, 0.08); box-shadow: inset 0 0 0 1px rgba(232, 193, 105, 0.38); color: var(--ink); font-size: 16px; line-height: 1.45; text-wrap: balance; }
.kt-start-done { margin: 20px 0 0; font-family: var(--serif); font-size: 22px; line-height: 1.3; color: var(--ink); }
.kt-start-go { width: 100%; max-width: 340px; min-height: 56px; margin: 28px 0 0; font-size: 17px; }
.kt-start-how { margin: 8px 0 0; }
.kt-keys { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
@media (hover: none), (max-width: 700px) { .kt-keys { display: none; } }
@media (max-height: 640px) {
  .kt-start-emb { margin-bottom: 10px; }
  .kt-start-emb .kt-emb { width: 56px; height: 56px; }
  .kt-start-name { font-size: 44px; }
  .kt-start-promise { margin-top: 12px; }
  .kt-start-go { margin-top: 18px; }
}
/* the smallest phones and phones on their side: the challenge, Play and How to play all in view */
@media (max-height: 600px) {
  .kt-start { padding-top: 10px; }
  .kt-start-emb { margin-bottom: 6px; }
  .kt-start-emb .kt-emb { width: 44px; height: 44px; }
  .kt-start-name { font-size: 38px; }
  .kt-start-meta { margin-top: 6px; font-size: 15px; }
  .kt-diff { margin-top: 10px; padding: 6px 13px; font-size: 14px; }
  .kt-start-promise { margin-top: 10px; font-size: 16px; line-height: 1.4; }
  .kt-chal { margin-top: 12px; padding: 9px 14px; font-size: 15px; line-height: 1.4; }
  .kt-start-go { margin-top: 14px; min-height: 52px; }
  .kt-start-how { margin-top: 2px; }
  .kt-tour-note { margin-top: 4px; font-size: 14px; }
}
/* a phone on its side: two columns, the name on the left, the challenge and Play on the right */
@media (max-height: 460px) and (min-width: 600px) {
  .kt-start-in { max-width: 780px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row dense; column-gap: 32px; align-content: center; justify-items: center; }
  .kt-start-in > * { grid-column: 1; }
  .kt-start-in > .kt-chal, .kt-start-in > .kt-start-done, .kt-start-in > .kt-start-go, .kt-start-in > .kt-start-how, .kt-start-in > .kt-tour-note, .kt-start-in > .kt-keys { grid-column: 2; }
  .kt-start-in > .kt-chal { margin-top: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .kt-start-in > * { animation: kt-settle 360ms var(--gm-quart) both; }
  .kt-start-in > :nth-child(2) { animation-delay: 60ms; }
  .kt-start-in > :nth-child(3) { animation-delay: 100ms; }
  .kt-start-in > :nth-child(4) { animation-delay: 140ms; }
  .kt-start-in > :nth-child(n + 5) { animation-delay: 180ms; }
}

/* ---- how to play: three visual steps ---- */
.kt-how .gm-sheet-body { padding-bottom: 2px; }
.kt-how-stage { position: relative; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.kt-demo { position: relative; display: grid; place-items: center; height: 184px; margin: 6px 0 0; padding: 12px; border-radius: 18px; background: #0d0d10; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.kt-how .kt-how-text { margin: 18px auto 0; max-width: 26ch; min-height: 2.7em; font-family: var(--serif); font-size: 21px; line-height: 1.35; color: var(--ink); text-align: center; text-wrap: balance; }
.kt-dots { display: flex; justify-content: center; margin: 6px 0 0; }
.kt-dot { display: grid; place-items: center; width: 40px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.kt-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgba(241, 239, 233, 0.22); transition: background-color 160ms var(--ease), transform 200ms var(--gm-quart); }
.kt-dot[aria-current="step"]::before { transform: scale(1.3); background: var(--gold); }
.kt-how-nav { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; }
.kt-how-nav .gm-primary { flex: 1 1 auto; }
.kt-how-nav .gm-quiet { flex: none; min-width: 96px; }
.kt-how-nav [hidden] { display: none; }
.kt-more { margin: 16px 0 0; border-top: 1px solid var(--line); }
.kt-more summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; list-style: none; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.kt-more summary::-webkit-details-marker { display: none; }
.kt-more summary::after { content: ""; width: 7px; height: 7px; margin: -4px 4px 0 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 160ms var(--ease); }
.kt-more[open] summary::after { margin-top: 3px; transform: rotate(225deg); }
.kt-more summary:hover { color: var(--ink); }
.kt-more-body { padding: 0 0 6px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.kt-more-body p, .kt-more-body li { margin: 0 0 8px; }
.kt-more-body ul { margin: 0; padding-left: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .kt-step-in { animation: kt-step 300ms var(--gm-expo) both; }
  .kt-step-in.is-back { animation-name: kt-step-back; }
}
/* a phone on its side: How to play in two columns (the step on the left; the dots, Next and the
   fine print on the right), so Next is on screen without scrolling the sheet */
@media (max-height: 500px) and (min-width: 600px) {
  .gm-scrim { padding: 8px 16px; }
  .gm-sheet { max-height: calc(100dvh - 16px); }
  .gm-sheet.kt-how { max-width: 760px; }
  .kt-how .gm-sheet-head { padding: 6px 0 4px; }
  .kt-how .gm-sheet-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 24px; align-items: center; }
  .kt-how .gm-sheet-body > * { grid-column: 2; }
  .kt-how .gm-sheet-body > .kt-how-stage { grid-column: 1; grid-row: 1 / span 3; }
  .kt-how .kt-demo { height: 136px; }
  .kt-how .kt-demo > * { scale: 0.74; }
  .kt-how .kt-how-text { margin-top: 10px; min-height: 0; font-size: 18px; }
  .kt-how .kt-more { margin-top: 8px; }
}
@keyframes kt-step { from { opacity: 0; translate: 28px 0; } }
@keyframes kt-step-back { from { opacity: 0; translate: -28px 0; } }

/* the coach: a ring and a short line pointing at exactly what to do (a game's guided first round) */
.kt-coach { position: fixed; z-index: 45; pointer-events: none; border-radius: 14px; box-shadow: 0 0 0 2px var(--gold), 0 0 0 7px rgba(232, 193, 105, 0.22); }
.kt-coach-tip { position: fixed; z-index: 46; max-width: min(300px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(232, 193, 105, 0.55); background: #222226; box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.9); color: var(--ink); font-size: 15.5px; font-weight: 600; line-height: 1.35; text-align: center; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .kt-coach { animation: kt-coach 1.5s ease-in-out infinite; }
  .kt-coach-tip { animation: kt-settle 280ms var(--gm-quart) both; }
}
@keyframes kt-coach { 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 0 12px rgba(232, 193, 105, 0.06); } }

/* ---- the result frame: one family for every game's end ---- */
.kt-result { width: 100%; max-width: var(--gm-col, 600px); margin-inline: auto; padding: 22px 0 8px; }
.kt-result-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.kt-result-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--muted); }
.kt-result-head .kt-emb { color: var(--gold); }
.kt-verdict { font-size: clamp(36px, 10vw, 50px); line-height: 1.06; }
.kt-result .gm-sub { margin-top: 8px; }
.kt-preview-wrap { display: flex; justify-content: center; margin: 20px 0 2px; }
.kt-preview { display: block; width: min(62vw, 250px); height: auto; aspect-ratio: 4 / 5; border-radius: 16px; background: #0c0c0e; box-shadow: 0 0 0 1px rgba(241, 239, 233, 0.12), 0 26px 50px -26px rgba(0, 0, 0, 0.95); }
.kt-result .gm-acts { margin-top: 22px; }
.kt-result .gm-acts > .gm-quiet { flex: 1 1 160px; }
.kt-links { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 8px 0 0; }
.kt-result .gm-count { margin-top: 12px; }
@media (min-width: 640px) {
  .kt-result-grid { grid-template-columns: minmax(0, 1fr) 232px; column-gap: 32px; align-items: start; }
  .kt-result-grid > :not(.kt-preview-wrap) { grid-column: 1; }
  .kt-preview-wrap { grid-column: 2; grid-row: 1 / span 8; margin: 6px 0 0; }
  .kt-preview { width: 232px; }
}
@media (max-height: 700px) and (max-width: 639px) { .kt-preview { width: min(50vw, 200px); } }

/* the copy sheet a share falls back to */
.kt-copy { width: 100%; min-height: 150px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(241, 239, 233, 0.3); background: #0f0f12; color: var(--ink); font: 500 16px/1.5 var(--sans); resize: none; }

/* screen reader only, for the kit's live lines */
.kt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kt-preview.is-wait { color: transparent; }
@media (prefers-reduced-motion: no-preference) { .kt-preview { transition: opacity 240ms var(--gm-quart); } .kt-preview.is-wait { opacity: 0.35; } }

/* the start card's note when a guided first round comes first */
.kt-tour-note { margin: 10px 0 0; max-width: 34ch; font-size: 14.5px; line-height: 1.45; color: var(--muted); }

/* ===================================================================================
   ROUND 10: share and come back. The chat board, the friend link, the calendar chips, the
   tomorrow line and "All six done". Same type, spacing and curves as the frame above.
   =================================================================================== */

/* the hint bubble with a link in it: tappable only while it shows */
.gm-toast.has-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 10px; padding: 2px 18px; }
.gm-toast.has-act.is-on { pointer-events: auto; }
.gm-toast .kt-ask { min-height: 44px; color: var(--gold); text-decoration-color: rgba(232, 193, 105, 0.45); }
.gm-toast .kt-ask:hover { color: #f3d58f; }

/* how your chat did: the friend, the ones before them, then you with a quiet gold ring */
.kt-chat { margin: 22px 0 0; }
.kt-chat-h { margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.25; }
.kt-chat-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kt-chat-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 16px; min-height: 48px; padding: 13px 16px; border-radius: 14px; background: rgba(241, 239, 233, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.kt-chat-who { font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--muted); white-space: nowrap; }
.kt-chat-what { font-size: 16px; line-height: 1.4; color: var(--ink); text-align: right; overflow-wrap: break-word; text-wrap: balance; }
.kt-chat-row.is-you { background: rgba(232, 193, 105, 0.06); box-shadow: inset 0 0 0 1px rgba(232, 193, 105, 0.45); }
.kt-chat-row.is-you .kt-chat-who { color: var(--gold); }
@media (prefers-reduced-motion: no-preference) {
  .kt-chat-row { animation: kt-settle 360ms var(--gm-quart) both; animation-delay: calc(160ms + var(--i, 0) * 150ms); }
  .kt-chat-row.is-you { animation-name: kt-settle, kt-you; animation-duration: 360ms, 900ms; animation-delay: calc(160ms + var(--i, 0) * 150ms), calc(420ms + var(--i, 0) * 150ms); }
}
@keyframes kt-you { 40% { box-shadow: inset 0 0 0 1px rgba(232, 193, 105, 0.85), 0 0 0 4px rgba(232, 193, 105, 0.12); } }

/* a friend asked: the one line before Send a nudge */
.kt-nudge { margin: 18px 0 0; font-size: 16px; line-height: 1.5; color: var(--ink); }

/* all six done: the six marks, the words and the one primary */
.kt-morning { margin: 22px 0 0; padding: 18px 18px 18px; border-radius: 18px; background: #141417; box-shadow: inset 0 0 0 1px rgba(241, 239, 233, 0.12); }
.kt-morning-embs { display: flex; flex-wrap: wrap; gap: 10px 12px; margin: 0 0 14px; color: var(--gold); }
.kt-morning-h { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.2; letter-spacing: -0.005em; }
.kt-morning-p { margin: 4px 0 16px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.kt-morning .gm-primary, .kt-morning .gm-quiet { width: 100%; }
.kt-morning + .gm-acts { margin-top: 14px; }

/* the countdown's quiet second line, and the calendar chips under it */
.kt-tomorrow { margin: 4px 0 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.kt-remind { margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.kt-remind-q { margin: 0 0 6px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.kt-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.kt-chip { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 2px 0; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(241, 239, 233, 0.26); color: var(--ink); font-size: 14.5px; font-weight: 600; text-decoration: none; transition: border-color 160ms var(--ease), color 160ms var(--ease); -webkit-tap-highlight-color: transparent; }
.kt-chip::after { content: ""; position: absolute; inset: -2px; }
.kt-chip:hover { border-color: rgba(241, 239, 233, 0.6); }
.kt-chip:active { transform: scale(0.98); }
.kt-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.kt-remind-done { margin: 0; min-height: 44px; display: flex; align-items: center; font-size: 15px; color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) { .kt-remind-done { animation: kt-settle 280ms var(--gm-quart) both; } }

/* the lobby's Share your morning, under "All six puzzles done today" */
.kt-morning-lob { flex: 1 1 100%; margin: 6px 0 0; }
