:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #19222c;
  background: #f8fafb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --green: #319f68;
  --ink: #19222c;
  --muted: #607182;
  --line: #d6e0e8;
  --pagefind-ui-primary: #246e4d;
  --pagefind-ui-text: #19222c;
  --pagefind-ui-background: #fff;
  --pagefind-ui-border: #d6e0e8;
  --pagefind-ui-border-radius: 9px;
  --pagefind-ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-size: 1rem; background: radial-gradient(ellipse at 17% 22%, #f5faf7 0, transparent 40%), linear-gradient(#fbfcfd, #f6f8fb); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: #1d70c4; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid #2375bd; outline-offset: 4px; }
button:disabled { opacity: .5; cursor: default; }
.site { max-width: 1160px; margin: auto; padding: 20px 24px 32px; }
.site:has(.editor-page) { max-width: none; }
.skip-link { position: absolute; top: -100px; z-index: 10; padding: 12px; background: white; }
.skip-link:focus { top: 10px; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.5px; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid #218253; border-radius: 7px; background: #e1f4e9; box-shadow: inset 0 -4px #c8e9d7; color: #176b42; font-size: 16px; }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; }
.nav-link { padding: 8px 0; color: var(--muted); font-size: 14px; text-decoration: none; transition: color 150ms; }
.nav-link:hover, .nav-link.active { color: #187a4c; }
.nav-link.active { font-weight: 700; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); gap: 40px; align-items: center; margin: 40px 0 36px; }
.eyebrow { color: #246e4d; font-size: 11px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; margin: 0 0 12px; }
h1 { font-size: clamp(56px, 6vw, 80px); line-height: 1.06; letter-spacing: -3px; margin: 0 0 18px -2px; font-weight: 750; }
h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.25; letter-spacing: -.6px; }
h3 { line-height: 1.35; }
.hero-description { font-size: 1rem; line-height: 1.55; color: #3d4d5a; margin: 0 0 24px; letter-spacing: -.2px; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 7px; padding: 10px 16px; border: 1px solid transparent; font-weight: 750; font-size: 14px; text-decoration: none; transition: background 150ms, box-shadow 150ms, transform 150ms; }
.primary { color: white; background: var(--green); box-shadow: 0 15px 26px -12px #319f6855; }
.primary:hover { background: #248654; transform: translateY(-1px); }
.secondary { background: #ffffffc7; border-color: #b9cadb; color: #263544; }
.secondary:hover { background: #edf5f1; border-color: #8cb8a1; }
.preview-window { overflow: hidden; border: 1px solid #acbece; border-radius: 9px; background: white; box-shadow: 0 24px 40px #26394d20; width: 100%; }
.preview-titlebar { background: linear-gradient(#f5faff, #dce7f2); padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; color: #344757; font-size: 14px; border-bottom: 1px solid #aab9c5; }
.window-controls { display: flex; gap: 5px; }
.window-controls span { width: 12px; height: 12px; background: white; border: 1px solid #9cb0c3; border-radius: 3px; }
.preview-board { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); background: #233342; padding: 10px; }
.game-tile { display: block; width: 100%; aspect-ratio: 1; background-image: url('/spritesheets/candy.png'); background-size: 1000% 800%; }
.preview-status { border-top: 1px solid #b4c1cc; padding: 14px; display: flex; justify-content: space-between; gap: 8px; font-size: 15px; color: #546477; }
.preview-status strong { color: #263544; }
.prose { max-width: 680px; font-size: 1rem; line-height: 1.65; color: #40515f; overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3, .prose strong { color: var(--ink); }
.prose a { font-weight: 650; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 23px; margin: 16px 0 24px; }
.prose li { padding-left: 1px; margin-bottom: 10px; }
.prose h2 { margin-top: 32px; }
.prose pre { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #edf3f4; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose code { font-size: .88em; background: #eaf1ed; border-radius: 3px; padding: 2px 4px; }
.prose pre code { padding: 0; background: none; }
.prose blockquote { border-left: 3px solid var(--green); margin-left: 0; padding-left: 20px; }
.prose table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose dt { color: var(--ink); font-weight: 700; }
.prose dd { margin-left: 22px; }
.prose .anchor { color: inherit; }
.text-section { border-top: 1px solid var(--line); padding: 24px 0 28px; }
.text-section h2 { margin-top: 0; }
.text-section p, .text-section ul { font-size: 1rem; line-height: 1.55; margin: 0 0 14px; letter-spacing: -.1px; }
.text-section ul { color: var(--muted); margin-top: 16px; margin-bottom: 0; }
.text-section:last-child { padding-bottom: 40px; }
.site-footer { border-top: 1px solid var(--line); max-width: 760px; padding-top: 28px; margin-top: 40px; }
body:has(.hero) .site-footer { margin-top: 0; }
.retro-window { border: 1px solid #000; background: #c0c0c0; padding: 1px; font-family: Arial, sans-serif; }
.retro-title { display: grid; grid-template-columns: 20px minmax(0, 1fr) 40px; align-items: center; height: 20px; background: #000080; color: white; font-size: 12px; line-height: 18px; text-align: center; border-bottom: 1px solid black; }
.retro-title strong { font-weight: 700; }
.retro-system-menu, .retro-controls span { display: grid; place-items: center; width: 20px; height: 19px; background: #c0c0c0; border-left: 1px solid #000; box-shadow: inset 1px 1px #fff, inset -1px -1px #808080; }
.retro-system-menu { border-left: 0; border-right: 1px solid #000; box-shadow: none; }
.retro-system-menu::before { content: ""; box-sizing: border-box; width: 13px; height: 3px; border: 1px solid #000; background: #fff; box-shadow: 1px 1px #808080; }
.retro-controls { display: flex; }
.retro-controls span::before { content: ""; width: 7px; height: 4px; background: #000; clip-path: polygon(0 0, 7px 0, 7px 1px, 6px 1px, 6px 2px, 5px 2px, 5px 3px, 4px 3px, 4px 4px, 3px 4px, 3px 3px, 2px 3px, 2px 2px, 1px 2px, 1px 1px, 0 1px); }
.retro-controls span:last-child::before { transform: rotate(180deg); }
.retro-body { display: flex; align-items: center; gap: 20px; padding: 12px; }
.release-badge { flex-shrink: 0; width: 140px; height: 100px; border: 1px solid #000; background-color: #243342; background-image: linear-gradient(#ffffff14 1px, transparent 1px), linear-gradient(90deg, #ffffff14 1px, transparent 1px); background-size: 8px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; }
.release-badge strong { font-size: 46px; line-height: 1; letter-spacing: -2px; }
.release-badge span { margin-top: 12px; text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.retro-body p { margin: 0; font-size: 14px; line-height: 1.5; letter-spacing: -.1px; }
.retro-body a { font-weight: 750; }
.footer-credit { color: #607182; font-size: 14px; line-height: 1.7; margin: 30px 0 0; }
.workspace-page { max-width: 1120px; margin: 40px auto 0; min-width: 0; }
.workspace-page h1 { font-size: 32px; letter-spacing: -1px; line-height: 1.15; margin: 0 0 18px; overflow-wrap: anywhere; }
.workspace-page .eyebrow { font-size: 11px; margin-bottom: 10px; }
.reading-page { max-width: 680px; min-height: 40vh; }
.page-intro { font-size: 1rem; color: var(--muted); line-height: 1.6; max-width: 640px; margin: 14px 0; }
.game-page { max-width: 720px; }
.player-account { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.player-account [hidden] { display: none !important; }
.account-label, .account-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-label p { color: var(--muted); font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.account-avatar { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border: 1px solid #c9dfd1; border-radius: 50%; background: #eaf4ee; color: #246e4d; font-size: 12px; font-weight: 800; }
.account-actions { flex-shrink: 0; }
.account-link { padding: 6px 0; border: 0; background: none; color: #246e4d; font-size: 13px; font-weight: 650; text-underline-offset: 4px; }
.account-link:hover { text-decoration: underline; }
.score-dialog { width: 500px; max-width: calc(100% - 32px); max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 1px solid #d0ded5; border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 24px 100px #10291f40; }
.score-dialog::backdrop { background: #10291f66; backdrop-filter: blur(4px); }
body:has(.score-dialog[open]) { overflow: hidden; }
.score-dialog-body { position: relative; padding: 30px; }
.dialog-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f2f6f3; color: #607182; font-size: 24px; line-height: 1; }
.dialog-close:hover { background: #e3eee7; color: #246e4d; }
.completion-emblem { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 20px; color: #218253; background: #e8f5ed; border: 1px solid #cfe7d8; border-radius: 16px; }
.completion-emblem svg { width: 32px; height: 32px; }
.score-dialog .eyebrow { margin: 2px 34px 10px 0; }
.score-dialog h2 { margin: 0 0 10px; font-size: 29px; letter-spacing: -1px; }
.dialog-description { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.completion-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 22px 0; padding: 18px 20px; border: 1px solid #cfe4d7; border-radius: 12px; background: linear-gradient(110deg, #f0f8f3, #f9fcfa); }
.stat-label { display: block; margin-bottom: 6px; color: #537761; font-size: 10px; font-weight: 750; letter-spacing: 1.3px; }
.completion-summary strong { display: block; font-size: 17px; }
.completion-score { display: flex; align-items: baseline; gap: 6px; color: #218253; }
.completion-score strong { font-size: 34px; letter-spacing: -1px; }
.completion-score span { color: #537761; font-size: 13px; }
.leaderboard { margin-top: 24px; }
.leaderboard h3 { margin: 0 0 8px; font-size: 16px; letter-spacing: -.3px; }
.leaderboard .field-hint { margin-bottom: 10px; overflow-wrap: anywhere; }
.scores-table-wrap { overflow: hidden; border: 1px solid #dce8e0; border-radius: 9px; }
.scores-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; text-align: left; }
.scores-table th { background: #f1f6f3; color: #537761; font-size: 11px; font-weight: 700; }
.scores-table th, .scores-table td { padding: 8px 10px; overflow-wrap: anywhere; }
.scores-table th:first-child { width: 52px; }
.scores-table th:last-child { width: 76px; text-align: right; }
.scores-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.scores-table tbody tr + tr { border-top: 1px solid #e2eae5; }
.scores-table .your-score { background: #edf8f1; color: #176b42; }
.score-you { display: inline-block; margin-left: 6px; padding: 2px 5px; border-radius: 4px; background: #d7eddf; font-size: 10px; font-weight: 700; }
.leaderboard > .account-link { margin-top: 8px; }
.login-options { margin-top: 24px; }
.login-options h3 { margin: 0 0 7px; font-size: 16px; letter-spacing: -.3px; }
.login-intro { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-methods { display: flex; gap: 4px; padding: 4px; margin-bottom: 20px; border: 1px solid #e1e8e3; border-radius: 9px; background: #f1f5f2; }
.login-methods button { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; padding: 10px; border: 1px solid transparent; border-radius: 6px; color: #66796d; background: none; font-size: 13px; font-weight: 700; }
.login-methods button:hover { color: #246e4d; }
.login-methods button[aria-pressed="true"] { border-color: #d9e3dc; color: #246e4d; background: white; box-shadow: 0 2px 4px #213c2b08; }
.login-methods span { font-size: 17px; line-height: 1; }
.login-methods svg { width: 18px; height: 18px; }
.login-form { display: flex; flex-direction: column; gap: 9px; }
.login-form label { font-size: 13px; font-weight: 700; }
.login-form input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #bdcfc3; border-radius: 8px; color: var(--ink); background: #fcfefd; font-size: 14px; }
.login-form input::placeholder { color: #8b9c91; }
.login-form input:focus-visible { outline: 2px solid #319f6866; outline-offset: 2px; border-color: var(--green); }
.login-form > .button, .login-actions { margin-top: 7px; }
.login-form .button { min-height: 44px; gap: 12px; box-shadow: none; }
.login-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.login-actions .button { flex: 1; padding-left: 10px; padding-right: 10px; }
.field-hint { margin: 0; color: #718278; font-size: 12px; line-height: 1.5; }
.save-as { margin: 22px 0 0; padding: 12px 14px; border: 1px solid #dce8e0; border-radius: 8px; color: #246e4d; background: #f5faf7; font-size: 13px; overflow-wrap: anywhere; }
.dialog-message { margin: 16px 0 0; padding: 12px 14px; color: #354e40; background: #edf6f0; border-radius: 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.score-dialog [role="status"]:empty { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 22px; margin-top: 22px; border-top: 1px solid #e2eae5; }
.dialog-actions .button { flex: 1; box-shadow: none; }
.score-footnote { color: #829087; text-align: center; font-size: 11px; line-height: 1.5; margin: 14px 0 0; }
.editor-page { max-width: none; }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.game-heading h1 { font-size: 28px; margin-bottom: 0; }
.workspace-back { font-size: 14px; color: #246e4d; font-weight: 600; text-decoration: none; white-space: nowrap; }
.workspace-back:hover { text-decoration: underline; }
.game-frame { border: 1px solid #acbece; border-radius: 9px; overflow: hidden; background: white; }
.game-frame kye-game { margin-top: 0; border: 0; border-radius: 0; }
.game-toolbar { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.game-toolbar-actions { display: flex; gap: 8px; }
.button.small { font-size: 14px; min-height: 38px; padding: 8px 14px; border-radius: 6px; }
.file-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; font-size: 14px; font-weight: 600; }
.file-control input { max-width: 100%; font-size: 13px; }
.file-control input::file-selector-button { padding: 8px 12px; margin-right: 10px; border: 1px solid #b9cadb; background: white; color: #263544; border-radius: 6px; cursor: pointer; }
kye-game, kye-editor { display: block; max-width: 100%; min-width: 0; margin-top: 22px; }
.supporting-text { color: var(--muted); font-size: 14px; line-height: 1.6; }
.help-panel, .notice { background: #eaf4ee; border: 1px solid #ccdfd1; border-radius: 8px; padding: 14px 18px; margin: 20px 0; font-size: 14px; line-height: 1.6; color: #354e40; }
.help-panel h2 { margin: 0; font-size: 1rem; letter-spacing: normal; }
.help-panel p { margin: 12px 0 0; }
kbd { display: inline-block; min-width: 1.6em; padding: .05em .3em; border: 1px solid #b9cadb; border-bottom-width: 3px; border-radius: 4px; background: #fff; color: var(--ink); font: .875em ui-monospace, monospace; line-height: 1.4; text-align: center; white-space: nowrap; }
.docs-layout { display: grid; grid-template-columns: 210px minmax(0, 680px); gap: 40px; max-width: 1000px; align-items: start; }
.docs-sidebar { position: sticky; top: 24px; font-size: 14px; }
.docs-search { display: flex; gap: 12px; justify-content: space-between; padding: 12px; border: 1px solid #cbdcd1; border-radius: 7px; color: #246e4d; background: #edf6f0; text-decoration: none; margin-bottom: 28px; }
.docs-sidebar nav { display: block; }
.docs-sidebar ul { list-style: none; padding: 0; margin: 8px 0 0; }
.docs-sidebar ul ul { padding-left: 14px; margin-top: 0; border-left: 1px solid var(--line); margin-left: 9px; }
.docs-sidebar li { margin: 0; }
.docs-sidebar li a { display: block; padding: 9px 10px; color: #546477; text-decoration: none; border-radius: 5px; }
.docs-sidebar li a:hover { background: #eaf2ed; color: #246e4d; }
.docs-sidebar li a.active { background: #e1f1e7; color: #176b42; font-weight: 700; }
.sidebar-heading { display: block; padding: 0 10px; font-weight: 750; color: var(--ink); text-decoration: none; }
.document { min-width: 0; }
.document h2, .document h3 { scroll-margin-top: 24px; }
.document-back { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 40px !important; font-size: 14px; }
.page-cards { display: grid; gap: 12px; margin-top: 28px; }
.page-card { display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; text-decoration: none; background: #ffffffa8; }
.page-card:hover { border-color: #8cb8a1; background: #edf5f1; }
.page-card strong { display: flex; justify-content: space-between; gap: 12px; }
.page-card > span { font-size: 14px; color: var(--muted); font-weight: 400; }
.empty-state { padding: 36px; border: 1px solid var(--line); background: #edf6f0; border-radius: 12px; margin: 32px 0; }
.empty-state p { color: #546477; line-height: 1.6; margin-bottom: 24px; }
.text-link { display: inline-block; margin: 16px 0 0 20px; font-size: 15px; }
.post-preview { border-top: 1px solid var(--line); padding: 32px 0; }
.post-preview h2 a { color: var(--ink); text-decoration: none; }
.post-preview h2 a:hover { color: #246e4d; }
.post-date, .post-preview time { display: block; color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.pagination { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; border-top: 1px solid var(--line); padding-top: 24px; }
.search-page #search { margin: 30px 0; }
@media (max-width: 1100px) {
  .site { padding: 20px 24px 32px; }
  .hero { gap: 32px; margin-right: 0; }
  .hero h1 { font-size: clamp(56px, 6vw, 80px); }
  .site-header nav { padding-right: 0; gap: 22px; }
  .preview-status { font-size: 12px; padding: 11px; }
  .docs-layout { gap: 32px; grid-template-columns: 210px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .site { padding: 18px 22px 30px; }
  .site-header { flex-wrap: wrap; gap: 18px; }
  .site-header nav { gap: 22px; }
  .nav-link { font-size: 14px; }
  .brand { font-size: 16px; gap: 9px; }
  .brand-mark { width: 32px; height: 32px; }
  .hero { grid-template-columns: 1fr; gap: 28px; margin-top: 36px; margin-bottom: 32px; }
  .hero-copy { max-width: 560px; }
  .hero h1 { font-size: clamp(52px, 10vw, 72px); margin-bottom: 18px; }
  .hero-description { font-size: 1rem; margin-bottom: 22px; }
  .eyebrow { font-size: 11px; }
  .preview-window { max-width: 580px; }
  .preview-status { font-size: 14px; }
  .text-section { padding: 24px 0; }
  h2 { font-size: 22px; }
  .text-section:last-child { padding-bottom: 40px; }
  .retro-body { gap: 17px; }
  .workspace-page { margin-top: 36px; }
  .workspace-page h1 { font-size: 28px; }
  .game-heading h1 { font-size: 26px; }
  .docs-layout { grid-template-columns: 1fr; gap: 32px; }
  .docs-sidebar { position: static; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
  .docs-search { margin-bottom: 18px; }
  .docs-sidebar nav > ul { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .docs-sidebar nav > ul > li { flex: 1 1 150px; }
  .game-heading { align-items: flex-start; }
}
@media (max-width: 440px) {
  .player-account { align-items: flex-start; }
  .account-label { gap: 8px; }
  .account-actions { gap: 10px; }
  .score-dialog-body { padding: 20px; }
  .completion-emblem { width: 40px; height: 40px; margin-bottom: 12px; border-radius: 12px; }
  .score-dialog h2 { font-size: 26px; }
  .completion-summary { margin: 16px 0; padding: 14px 16px; }
  .completion-score strong { font-size: 30px; }
  .login-options { margin-top: 12px; }
  .login-intro { margin-bottom: 8px; }
  .login-methods { margin-bottom: 14px; }
  .login-methods button { padding: 9px; }
  .login-actions { flex-direction: column; }
  .dialog-actions { margin-top: 12px; padding-top: 12px; }
  .score-footnote { margin-top: 12px; }
  .site { padding-left: 18px; padding-right: 18px; }
  .site-header nav { gap: 18px; width: 100%; justify-content: space-between; }
  .nav-link { font-size: 13px; }
  .brand { font-size: 15px; }
  .hero { margin-top: 32px; }
  .hero-actions .button { flex: 1; padding-left: 10px; padding-right: 10px; font-size: 14px; }
  .preview-board { padding: 7px; }
  .preview-status { font-size: 12px; padding: 12px 10px; }
  .retro-body { flex-direction: column; align-items: stretch; }
  .release-badge { width: 100%; }
  .retro-body p { padding: 0 3px 3px; }
  .site-footer { padding-top: 28px; }
  .game-heading .eyebrow { font-size: 9px; }
  .game-heading h1 { font-size: 25px; }
  .workspace-back { font-size: 12px; }
  .empty-state { padding: 24px; }
  .text-link { display: block; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
