:root {
  color-scheme: light;
  --paper: #f4f5f0;
  --card: #fff;
  --ink: #17251e;
  --muted: #7a817b;
  --line: #e5e8e0;
  --green: #789b4d;
  --yellow: #d9a936;
  --gray: #798078;
  --shadow: 0 18px 55px rgba(34,49,37,.07), 0 2px 8px rgba(34,49,37,.035);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
* { box-sizing: border-box; }
body {
  min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink);
  background: radial-gradient(ellipse at 50% 2%, rgba(219,226,205,.42), transparent 38rem), var(--paper);
}
button { font: inherit; }
.page-shell { width: min(100% - 44px, 960px); margin: 0 auto; }
.topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(23,37,30,.09); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; padding: 7px 6px; display: flex; align-items: end; gap: 3px; border-radius: 10px; background: var(--ink); }
.brand-mark i { display: block; width: 4px; border-radius: 3px; background: #bdd38c; }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 11px; }
.brand-name { font-size: 15px; font-weight: 800; letter-spacing: -.065em; }
.brand-name span { margin-left: 4px; color: var(--green); font-weight: 600; letter-spacing: -.045em; }
.topbar-actions { display: flex; gap: 8px; }
.icon-button {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--line);
  border-radius: 12px; color: #687169; background: rgba(255,255,255,.62); cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.icon-button:hover { color: var(--ink); border-color: #ccd2c7; background: #fff; transform: translateY(-1px); }
.icon-button svg, .share-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.intro { padding: 59px 0 28px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: #78816f; font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #8ca95e; box-shadow: 0 0 0 4px rgba(140,169,94,.14); }
.eyebrow-line { width: 19px; height: 1px; margin: 0 2px; background: #c9d0c1; }
h1 { margin: 20px 0 13px; font-size: clamp(35px,5vw,48px); font-weight: 800; letter-spacing: -.075em; line-height: 1.12; }
h1 span { color: var(--green); }
.intro-copy { margin: 0; color: #7c827b; font-size: 14px; letter-spacing: -.015em; }
.date-row { width: min(290px,80%); margin: 25px auto 0; display: flex; align-items: center; gap: 13px; color: #8b9189; font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.date-rule { height: 1px; flex: 1; background: #dfe3da; }
.length-picker { margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #90978e; font-family: ui-monospace, monospace; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.length-options { display: flex; gap: 4px; padding: 3px; border: 1px solid #e2e6dc; border-radius: 11px; background: rgba(255,255,255,.55); }
.length-button { width: 31px; height: 29px; border: 0; border-radius: 8px; color: #7f887c; background: transparent; font-family: ui-monospace, monospace; font-size: 12px; font-weight: 600; cursor: pointer; transition: color .16s ease, background .16s ease, transform .16s ease; }
.length-button:hover { color: var(--ink); background: #fff; }
.length-button.is-active { color: #fff; background: var(--ink); box-shadow: 0 2px 5px rgba(23,37,30,.13); }
.game-card { width: min(100%,490px); margin: 0 auto; padding: 22px 31px 19px; border: 1px solid rgba(226,230,220,.95); border-radius: 23px; background: var(--card); box-shadow: var(--shadow); }
.game-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; color: #858b83; font-size: 11px; }
.game-label { letter-spacing: .015em; }
.game-label strong { color: #4d594e; font-weight: 700; }
.attempts-label { color: var(--ink); font-family: ui-monospace, monospace; font-size: 12px; font-weight: 500; }
.attempts-label span { color: #a3a9a1; font-weight: 400; }
.board { width: max-content; margin: 0 auto; display: grid; grid-template-columns: repeat(var(--columns,5),var(--tile-size,52px)); gap: 7px; }
.tile {
  width: var(--tile-size,52px); height: var(--tile-size,52px); display: grid; place-items: center; border: 1px solid #dce1d8; border-radius: 11px;
  color: var(--ink); background: #fff; font-family: ui-monospace, monospace; font-size: 23px; font-weight: 500;
  text-transform: uppercase; transition: transform .16s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.tile.filled { border-color: #aab69c; animation: pop .12s ease-out; }
.tile.tile-correct { color: #fff; border-color: var(--green); background: var(--green); }
.tile.tile-present { color: #fff; border-color: var(--yellow); background: var(--yellow); }
.tile.tile-absent { color: #fff; border-color: var(--gray); background: var(--gray); }
.tile.reveal { animation: flip .42s ease both; }
.feedback { height: 31px; display: grid; place-items: center; color: #5e685d; font-size: 12px; font-weight: 700; }
.feedback:empty { visibility: hidden; }
.feedback.success { color: var(--green); }
.feedback.failure { color: #9b6c37; }
.keyboard { display: grid; gap: 7px; margin-top: 5px; }
.keyboard-row { display: flex; justify-content: center; gap: 5px; }
.key {
  min-width: 32px; height: 43px; padding: 0 7px; border: 0; border-radius: 8px; color: #475147;
  background: #edf0e9; font-family: ui-monospace, monospace; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: filter .15s ease, transform .12s ease, background .15s ease, color .15s ease; -webkit-tap-highlight-color: transparent;
}
.key:hover { filter: brightness(.97); }
.key:active { transform: translateY(1px); }
.key.key-wide { min-width: 58px; font-family: inherit; font-size: 10px; font-weight: 800; letter-spacing: -.03em; }
.key.key-correct { color: #fff; background: var(--green); }
.key.key-present { color: #fff; background: var(--yellow); }
.key.key-absent { color: #fff; background: #9ba19a; }
.game-footer { min-height: 44px; margin-top: 8px; padding-top: 11px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #edf0ea; color: #a0a69d; font-size: 10px; }
.share-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 0; border-radius: 8px; color: #fff; background: var(--ink); font-size: 10px; font-weight: 700; cursor: pointer; }
.share-button svg { width: 14px; height: 14px; stroke-width: 2; }
.share-button:hover { background: #304137; }
.site-footer { min-height: 73px; margin-top: 33px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(23,37,30,.09); color: #a0a69d; font-size: 10px; }
.footer-seal { display: inline-flex; align-items: center; gap: 7px; font-family: ui-monospace, monospace; font-size: 9px; letter-spacing: .08em; }
.footer-seal i { width: 5px; height: 5px; border-radius: 50%; background: #9aae7b; }
.modal { width: min(100% - 32px,420px); padding: 25px; border: 1px solid #e2e6dc; border-radius: 19px; color: var(--ink); background: #fff; box-shadow: 0 25px 80px rgba(27,39,30,.19); }
.modal::backdrop { background: rgba(20,30,23,.32); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in .2s ease-out; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 19px; }
.modal-kicker { color: #89927f; font-family: ui-monospace, monospace; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
.modal h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.055em; }
.modal p { margin: 0 0 16px; color: #70796f; font-size: 13px; line-height: 1.7; }
.modal-close { width: 34px; height: 34px; border-radius: 10px; }
.modal-close svg { width: 16px; height: 16px; }
.example-tiles { display: flex; justify-content: center; gap: 6px; margin: 20px 0 17px; }
.example-tiles .tile { width: 42px; height: 42px; border-radius: 9px; font-size: 18px; }
.legend-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.legend-list li { display: flex; align-items: center; gap: 10px; color: #6e776d; font-size: 12px; }
.legend-list strong { color: #39443a; }
.legend-swatch { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 3px; }
.legend-swatch.correct { background: var(--green); }
.legend-swatch.present { background: var(--yellow); }
.legend-swatch.absent { background: var(--gray); }
.modal .modal-note { margin: 20px 0 0; padding-top: 15px; border-top: 1px solid #edf0ea; font-size: 11px; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin: 20px 0 25px; text-align: center; }
.stats-grid div { display: grid; gap: 3px; }
.stats-grid strong { font-family: ui-monospace, monospace; font-size: 23px; font-weight: 500; }
.stats-grid span { color: #899187; font-size: 9px; }
.stats-length { margin: -14px 0 21px !important; text-align: center; font-size: 10px !important; }
.distribution h3 { margin: 0 0 10px; font-size: 12px; }
#distribution-bars { display: grid; gap: 5px; }
.distribution-row { display: grid; grid-template-columns: 14px 1fr; align-items: center; gap: 6px; color: #70796f; font-family: ui-monospace, monospace; font-size: 10px; }
.distribution-bar { width: 9%; min-width: 22px; height: 17px; padding-right: 5px; display: flex; align-items: center; justify-content: end; border-radius: 4px; color: #fff; background: #a8b09f; font-size: 9px; transition: width .25s ease; }
.distribution-bar.is-best { background: var(--green); }
.text-button { margin: 20px 0 0; padding: 0; border: 0; color: #959c92; background: transparent; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-button:hover { color: #5e685d; }
.toast { position: fixed; z-index: 3; left: 50%; bottom: 26px; max-width: calc(100% - 36px); padding: 11px 16px; transform: translate(-50%,12px); border-radius: 10px; color: #fff; background: #26372d; box-shadow: 0 8px 25px rgba(22,34,25,.16); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.show { transform: translate(-50%,0); opacity: 1; }
@keyframes pop { 50% { transform: scale(1.08); } }
@keyframes flip { 0% { transform: rotateX(0); } 48% { transform: rotateX(90deg); } 52% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 520px) {
  .page-shell { width: min(100% - 28px,480px); }
  .topbar { min-height: 69px; }
  .intro { padding: 43px 0 23px; }
  h1 { margin-top: 17px; font-size: 37px; }
  .intro-copy { max-width: 280px; margin: 0 auto; font-size: 12px; line-height: 1.6; }
  .date-row { margin-top: 21px; font-size: 9px; }
  .length-picker { margin-bottom: 12px; font-size: 8px; }
  .length-button { width: 29px; height: 28px; }
  .game-card { padding: 17px 15px 13px; border-radius: 19px; }
  .game-topline { margin-bottom: 15px; }
  .board { gap: 5px; }
  .tile { border-radius: 9px; font-size: 21px; }
  .keyboard { gap: 7px; margin-top: 6px; }
  .keyboard-row { gap: 4px; }
  .keyboard-row { width: 100%; }
  .key { min-width: 0; width: auto; max-width: 36px; flex: 1; height: 42px; padding: 0; border-radius: 7px; font-size: 12px; }
  .key.key-wide { width: auto; max-width: 57px; flex: 1.7; font-size: 9px; }
  .game-footer { font-size: 9px; }
  .site-footer { min-height: 62px; margin-top: 23px; font-size: 9px; }
  .footer-seal { font-size: 8px; }
  .modal { padding: 21px; }
}
@media (max-width: 365px) {
  .game-card { padding-right: 10px; padding-left: 10px; }
  .key { height: 39px; }
  .game-footer { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
