:root {
  font-family: 'DM Sans', sans-serif;
  color: #242625;
  background: #fafaf9;
  --ink: #242625;
  --muted: #777b77;
  --surface: #fff;
  --soft: #f2f3f0;
  --line: #e4e6e1;
  --accent: #ad5946;
  --green: #42765c;
  --purple: #795d94;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
a { color: inherit; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.site-shell { max-width: 816px; margin: 0 auto; padding: 30px 28px 25px; }
.play-area { max-width: 584px; margin: 0 auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 36px; }
.brand { text-decoration: none; font-size: 29px; font-weight: 800; letter-spacing: -1.3px; }
.brand span { color: var(--accent); margin-left: 2px; }
.header-actions { display: flex; gap: 4px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; color: var(--muted); font-size: 26px; }
.icon-button:hover { background: var(--soft); color: var(--ink); }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.mode-tabs { display: flex; padding: 4px; gap: 4px; background: var(--soft); border-radius: 10px; margin-bottom: 35px; }
.mode-tab { flex: 1; padding: 10px; min-height: 42px; border: 0; background: none; border-radius: 7px; color: var(--muted); font-size: 14px; font-weight: 600; }
.mode-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px #0000000b; }
.mode-tab:hover { color: var(--ink); }
#game:focus { outline: none; }
.game-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.game-meta h2 { font: inherit; font-weight: 600; color: var(--ink); margin: 0; }
.prompt-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px 26px 28px; margin-bottom: 22px; }
.clue-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.clue-meta span:first-child { flex-shrink: 0; }
.clue-meta span:last-child { text-align: right; }
.prompt-text { font-size: 21px; line-height: 1.6; letter-spacing: -.3px; margin: 0; font-weight: 500; }
.rare .prompt-text { font-size: 27px; line-height: 1.35; font-weight: 650; letter-spacing: -.65px; }
.prompt-hint { font-size: 14px; line-height: 1.5; margin: 15px 0 0; color: var(--muted); }
.answer-row { display: flex; gap: 9px; }
.search-wrap { flex: 1; min-width: 0; position: relative; }
.diagnosis-input { width: 100%; min-height: 50px; padding: 12px 16px; border: 1px solid #d7dad3; border-radius: 9px; background: var(--surface); font-size: 16px; color: var(--ink); }
.diagnosis-input::placeholder { color: var(--muted); }
.primary-button { min-height: 50px; border: 1px solid var(--ink); background: var(--ink); color: var(--surface); border-radius: 9px; padding: 11px 22px; font-size: 15px; font-weight: 600; }
.primary-button:hover { opacity: .88; }
.secondary-button { min-height: 46px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); padding: 10px 18px; font-size: 14px; font-weight: 500; }
.secondary-button:hover { background: var(--soft); }
.text-button { background: none; border: 0; padding: 5px 0; font-size: 14px; color: var(--muted); }
.text-button:hover { color: var(--ink); }
.round-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.round-actions .text-button { min-height: 36px; }
.form-message { color: var(--accent); font-size: 14px; line-height: 1.5; margin: 10px 0 0; }
.form-message:empty { display: none; }
.suggestions { position: absolute; z-index: 10; top: calc(100% + 5px); left: 0; right: 0; list-style: none; margin: 0; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 8px 28px #0000000d; max-height: 230px; overflow-y: auto; }
.suggestions:empty { display: none; }
.suggestions li { padding: 11px 10px; border-radius: 5px; font-size: 14px; cursor: pointer; }
.suggestions li:hover, .suggestions li[aria-selected=true] { background: var(--soft); }
.disclosure { font-size: 14px; line-height: 1.7; margin: 16px 0; }
.disclosure summary { cursor: pointer; color: var(--muted); padding: 5px 0; }
.disclosure p { color: var(--muted); margin: 12px 0; }
.disclosure ol { padding-left: 20px; }
.disclosure li { padding: 5px 0; }
.guesses { display: grid; gap: 0; margin-top: 20px; }
.guess-row { display: flex; align-items: center; gap: 12px; font-size: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.guess-number { width: 12px; color: var(--muted); font-size: 12px; }
.guess-status { margin-left: auto; color: var(--muted); }
.guess-row.correct .guess-status { color: var(--green); }
.result { padding: 10px 0 12px; }
.result-status { color: var(--green); font-size: 14px; margin: 0 0 13px; }
.result-status.lost { color: var(--muted); }
.result h2 { margin: 0 0 12px; font-size: 30px; line-height: 1.25; letter-spacing: -.9px; font-weight: 650; }
.result p { font-size: 16px; line-height: 1.5; }
.result .muted { font-size: 14px; color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 8px; }
.source-link { font-size: 14px; text-underline-offset: 3px; }
.result-score { color: var(--purple); font-size: 56px; font-weight: 650; letter-spacing: -2px; line-height: 1.2; margin: 14px 0; }
.result-score small { color: var(--muted); font-size: 17px; font-weight: 400; letter-spacing: 0; }
.rare-answer-list { margin: 12px 0; }
.rare-answer, .rare-final-round { display: flex; gap: 15px; justify-content: space-between; border-top: 1px solid var(--line); padding: 10px 0; font-size: 14px; }
.rare-answer b, .rare-final-round strong { flex-shrink: 0; font-weight: 500; color: var(--purple); }
.rare-answer.picked { color: var(--green); }
.rare-final-round small { display: block; color: var(--muted); font-size: 13px; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 42px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
footer .text-button { font-size: 12px; }
dialog { width: min(440px, calc(100% - 32px)); max-height: 85dvh; overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; padding: 32px; background: var(--surface); color: var(--ink); box-shadow: 0 15px 70px #00000020; }
dialog::backdrop { background: #20272455; backdrop-filter: blur(3px); }
.modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; }
dialog h2 { font-size: 25px; letter-spacing: -.7px; margin: 0 28px 20px 0; line-height: 1.2; font-weight: 650; }
dialog h3 { font-size: 16px; margin-top: 24px; }
dialog p, dialog li { font-size: 15px; color: var(--muted); line-height: 1.65; }
dialog ol, dialog ul { padding-left: 21px; }
dialog li { margin-bottom: 9px; }
.menu-list { display: grid; gap: 3px; }
.menu-list>button { border: 0; border-radius: 8px; padding: 13px 12px; text-align: left; background: none; font-size: 16px; }
.menu-list>button:hover { background: var(--soft); }
.menu-settings { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.difficulty-toggle { display: flex; background: var(--soft); padding: 3px; border-radius: 7px; }
.difficulty-toggle button { border: 0; background: none; border-radius: 5px; padding: 7px 10px; font-size: 14px; }
.difficulty-toggle button.active { background: var(--surface); }
.modal-stats { display: grid; grid-template-columns: repeat(4,1fr); margin: 24px 0; text-align: center; gap: 5px; }
.modal-stats strong { font-size: 28px; display: block; font-weight: 600; }
.modal-stats span { font-size: 12px; color: var(--muted); }
.distribution-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; font-size: 14px; }
.distribution-bar { min-width: 26px; background: var(--soft); padding: 6px 10px; text-align: right; border-radius: 4px; }
.archive-list { display: grid; margin-top: 24px; }
.archive-item { border: 0; border-top: 1px solid var(--line); padding: 16px 0; background: none; display: flex; justify-content: space-between; text-align: left; font-size: 14px; }
.archive-item:hover { color: var(--accent); }
.archive-item small { font-size: 12px; color: var(--muted); }
.share-fallback { width: 100%; min-height: 130px; background: var(--soft); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 14px; font-size: 14px; line-height: 1.6; }
.storage-banner { font-size: 14px; line-height: 1.5; color: var(--accent); padding: 12px; background: var(--soft); border-radius: 8px; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); padding: 13px 20px; border-radius: 9px; background: var(--ink); color: var(--surface); font-size: 14px; max-width: 90vw; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 100; }
#toast.visible { opacity: 1; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { display: block; padding: 14px; }
[data-theme=dark] { background: #1c201e; color: #e7e9e5; --ink: #e7e9e5; --muted: #a0a89f; --surface: #242925; --soft: #2b312c; --line: #394039; --accent: #d3907c; --green: #a2c8ad; --purple: #bba8d0; }
[data-theme=dark] .diagnosis-input { border-color: var(--line); }
@media(max-width:600px) {
  .site-shell { padding: 25px 20px; }
  .masthead { margin-bottom: 28px; }
  .mode-tabs { margin-bottom: 29px; }
  .prompt-card { padding: 23px 21px; }
  .prompt-text { font-size: 20px; line-height: 1.55; }
  .rare .prompt-text { font-size: 25px; }
  .clue-meta { font-size: 12px; align-items: flex-start; }
  .clue-meta span:last-child { max-width: 65%; }
  .primary-button { padding: 11px 17px; }
  .diagnosis-input { padding: 12px; }
  footer { margin-top: 32px; }
  dialog { padding: 28px 24px; }
}
@media(max-width:360px) {
  .site-shell { padding: 20px 16px; }
  .prompt-card { padding: 21px 18px; }
  .prompt-text { font-size: 19px; }
  .answer-row { gap: 7px; }
  .primary-button { padding: 11px 14px; }
  .brand { font-size: 27px; }
}
@media(prefers-reduced-motion:reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* A compact clinical chart, with a little personality. */
:root { background: #f5f3eb; --surface: #fffef9; --soft: #eeece3; --line: #d3d2c7; --accent: #b95340; }
body { min-height: 100vh; background-image: linear-gradient(#62675a06 1px,transparent 1px),linear-gradient(90deg,#62675a06 1px,transparent 1px); background-size: 20px 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 31px; font-weight: 900; letter-spacing: -1.5px; }
.brand>img { image-rendering: pixelated; transform: rotate(-5deg); }
.brand .brand-word { color: var(--ink); margin: 0; }
.brand .brand-plus { color: var(--accent); margin-left: 2px; }
.masthead { padding-bottom: 19px; border-bottom: 1px solid var(--ink); margin-bottom: 27px; }
.mode-tabs { background: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; gap: 16px; margin-bottom: 28px; }
.mode-tab { border-radius: 0; padding: 11px 8px; position: relative; }
.mode-tab.active { background: none; box-shadow: none; }
.mode-tab.active::after { content: ''; position: absolute; height: 3px; background: var(--accent); left: 0; right: 0; bottom: -1px; }
.game-meta { font-family: 'IBM Plex Mono',monospace; font-size: 13px; }
.game-meta h2 { font-weight: 500; }
.prompt-card { border: 1px solid var(--ink); border-radius: 3px; box-shadow: 3px 3px 0 #25282c0d; background: var(--surface); }
.clue-meta { font-family: 'IBM Plex Mono',monospace; font-size: 12px; margin-bottom: 19px; }
.clue-meta>span:first-child { color: var(--accent); }
.prompt-text { font-size: 22px; font-weight: 500; }
.rare .prompt-text { font-weight: 750; }
.rare { border-top: 3px solid var(--purple); }
.diagnosis-input { border-radius: 3px; border-color: #a7aaa0; background: var(--surface); }
.primary-button { border-radius: 3px; box-shadow: 2px 2px 0 #bb685566; }
.secondary-button { border-radius: 3px; }
.suggestions { border-radius: 3px; border-color: #a7aaa0; }
.suggestions li { border-radius: 2px; }
.result-status, .result .muted { font-family: 'IBM Plex Mono',monospace; font-size: 13px; }
[data-theme=dark] { background: #1c201e; --surface: #242925; --soft: #2b312c; --line: #394039; --accent: #d3907c; }
[data-theme=dark] .prompt-card { border-color: #7c897d; box-shadow: 3px 3px 0 #00000028; }
@media(max-width:600px) { .brand { font-size: 29px; } .prompt-text { font-size: 20px; } .masthead { margin-bottom: 20px; padding-bottom: 16px; } }
@media(max-width:360px) { .prompt-text { font-size: 19px; } .brand>img { width: 30px; height: 34px; } }

/* Chart notes: the game's personality lives below the playing area. */
.masthead { padding: 15px 18px; margin-bottom: 28px; border: 1px solid var(--ink); background: var(--surface); box-shadow: 3px 3px 0 var(--ink); }
.about-game { margin-top: 55px; padding-top: 30px; border-top: 1px solid var(--ink); }
.section-label { margin: 0; font: 500 12px/1.5 'IBM Plex Mono', monospace; letter-spacing: .65px; color: var(--accent); }
.about-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 16px 0 21px; }
.about-game h1 { margin: 0; font-size: clamp(34px, 5.4vw, 49px); font-weight: 900; line-height: 1.08; letter-spacing: -2.1px; }
.about-game h1 span { color: var(--accent); }
.about-copy { max-width: 650px; margin: 0; font-size: 17px; line-height: 1.8; color: var(--body-copy); }
:root { --body-copy: #555a53; --note: #f7ecd3; --note-line: #c6af82; }
.brain-note { width: 150px; flex-shrink: 0; display: grid; justify-items: center; position: relative; padding-top: 60px; margin-top: -40px; }
.brain-note img { image-rendering: pixelated; transform: rotate(-7deg); }
.brain-speech { position: absolute; top: 0; right: -2px; padding: 8px 12px; border: 1px solid var(--ink); background: var(--surface); font: 12px/1.45 'IBM Plex Mono', monospace; white-space: nowrap; transform: rotate(5deg); }
.brain-speech::after { content: ''; width: 8px; height: 8px; position: absolute; bottom: -5px; left: 19px; border-bottom: 1px solid var(--ink); border-right: 1px solid var(--ink); background: var(--surface); transform: rotate(45deg); }
.how-section { margin-top: 42px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.section-heading h2 { font-size: 25px; line-height: 1.25; font-weight: 750; letter-spacing: -.8px; margin: 0; }
.section-heading>span { flex-shrink: 0; font: 12px/1.5 'IBM Plex Mono', monospace; color: var(--muted); }
.play-steps { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; counter-reset: steps; padding: 0; margin: 23px 0 0; gap: 25px; }
.play-steps li { counter-increment: steps; border-top: 1px solid var(--line); padding-top: 18px; }
.play-steps li::before { content: '0' counter(steps); display: block; margin-bottom: 12px; color: var(--accent); font: 500 13px 'IBM Plex Mono', monospace; }
.play-steps h3 { font-size: 17px; line-height: 1.4; margin: 0 0 8px; font-weight: 700; letter-spacing: -.2px; }
.play-steps p { color: var(--body-copy); font-size: 16px; line-height: 1.7; margin: 0; }
.rare-note { position: relative; margin-top: 42px; padding: 26px 30px; border: 1px solid var(--note-line); box-shadow: 3px 3px 0 #25282c0d; background: var(--note); }
.rare-note::before { content: ''; width: 76px; height: 20px; position: absolute; top: -10px; left: calc(50% - 38px); background: #d9cdbb85; border: 1px solid #8c765c0d; transform: rotate(-4deg); }
.rare-note-heading { display: flex; align-items: center; justify-content: space-between; }
.rare-note-heading .section-label { color: var(--body-copy); }
.rare-note-heading>span { color: var(--accent); font-size: 27px; line-height: 1; }
.rare-note h2 { font-size: 31px; line-height: 1.2; font-weight: 800; letter-spacing: -.9px; margin: 12px 0; }
.rare-note h2 span { color: var(--accent); }
.rare-note>p { font-size: 16px; line-height: 1.7; color: var(--body-copy); margin: 0; max-width: 600px; }
.score-scale { display: flex; border: 1px solid var(--note-line); margin-top: 22px; }
.score-scale>span { flex: 1; text-align: center; padding: 12px 4px; font: 500 19px/1.2 'IBM Plex Mono', monospace; }
.score-scale>span+span { border-left: 1px solid var(--note-line); }
.score-scale>span:last-child { background: var(--ink); color: var(--surface); }
.score-scale small { font: 12px 'IBM Plex Mono', monospace; }
.rare-note-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.rare-note-bottom p { margin: 0; color: var(--body-copy); font-size: 13px; line-height: 1.5; }
.rare-link { font-size: 14px; font-weight: 700; text-underline-offset: 4px; flex-shrink: 0; }
.rare-link:hover { color: var(--accent); }
.faq-section { margin-top: 48px; }
.faq-section .section-heading { margin-bottom: 24px; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 20px 0; list-style: none; font-size: 17px; line-height: 1.45; font-weight: 600; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; flex-shrink: 0; width: 20px; text-align: center; color: var(--accent); font: 22px/1 'IBM Plex Mono', monospace; }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { color: var(--accent); }
.faq-item p { margin: -4px 35px 22px 0; color: var(--body-copy); font-size: 16px; line-height: 1.8; }
footer { margin-top: 38px; align-items: flex-start; padding-top: 22px; gap: 25px; }
footer strong, footer span { display: block; font-size: 13px; line-height: 1.6; }
footer strong { font-weight: 500; color: var(--body-copy); margin-bottom: 4px; }
.footer-links { display: flex; gap: 20px; }
footer .text-button { font-size: 13px; text-align: left; white-space: nowrap; }
[data-theme=dark] { --body-copy: #b9c0b6; --note: #303129; --note-line: #60604d; }
[data-theme=dark] .rare-note::before { background: #6e735f85; }
@media(max-width:600px) {
  .masthead { padding: 12px 14px; margin-bottom: 24px; }
  .about-game { margin-top: 38px; padding-top: 25px; }
  .about-heading-row { gap: 12px; margin: 18px 0; }
  .about-game h1 { font-size: clamp(30px, 7.6vw, 42px); letter-spacing: -1.3px; }
  .brain-note { width: 60px; padding-top: 0; margin-top: 0; }
  .brain-note img { width: 60px; height: 66px; }
  .brain-speech { display: none; }
  .about-copy { font-size: 16px; line-height: 1.75; }
  .section-heading h2 { font-size: 23px; }
  .how-section .section-heading>span { display: none; }
  .play-steps { grid-template-columns: 1fr; gap: 18px; margin-top: 20px; }
  .play-steps li { position: relative; padding: 18px 0 0 38px; }
  .play-steps li::before { position: absolute; top: 21px; left: 0; }
  .play-steps h3 { margin-bottom: 5px; }
  .rare-note { padding: 24px 20px; margin-top: 35px; }
  .rare-note h2 { font-size: 28px; max-width: 260px; }
  .rare-note-bottom { align-items: flex-start; flex-direction: column; gap: 14px; }
  .score-scale>span { font-size: 17px; }
  .score-scale small { font-size: 11px; }
  .faq-section { margin-top: 36px; }
  .faq-item summary { font-size: 16px; gap: 15px; padding: 18px 0; }
  .faq-item p { margin-right: 20px; line-height: 1.7; }
  footer { flex-direction: column; gap: 12px; margin-top: 30px; }
}
@media(max-width:360px) {
  .masthead { padding: 10px; }
  .about-game h1 { font-size: 29px; }
  .brain-note { width: 45px; }
  .brain-note img { width: 45px; height: 50px; }
  .rare-note { padding: 24px 16px; }
}
