@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;650;700&family=Manrope:wght@400;500;600;650;700;750;800&display=swap');

:root { color-scheme: light; font-family: 'DM Sans', sans-serif; color: #242c29; background: #f8f7f3; font-synthesis: none; --blue: #367bd6; --red: #db5966; --green: #359874; }
* { box-sizing: border-box; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid #242c29; outline-offset: 5px; }
.app { max-width: 1024px; margin: auto; padding: 28px 24px 24px; }
.header { display: flex; align-items: center; justify-content: space-between; }
.brand { color: inherit; text-decoration: none; font-family: 'Manrope', sans-serif; font-weight: 800; letter-spacing: -1.4px; font-size: 28px; display: flex; align-items: center; }
.brand-dot { color: #43866d; }
.brand-icon { display: flex; gap: 3px; margin-right: 10px; transform: rotate(-9deg); }
.brand-icon i { display: block; width: 5px; height: 21px; border-radius: 3px; background: var(--blue); }
.brand-icon i:nth-child(2) { background: var(--red); height: 27px; margin-top: -3px; }
.brand-icon i:nth-child(3) { background: var(--green); }
.edition { font-size: 10px; font-weight: 650; letter-spacing: 1.7px; color: #7b827b; }
.intro { text-align: center; margin: 48px 0 28px; }
.eyebrow { font-size: 9px; font-weight: 700; letter-spacing: 1.4px; color: #6b7c6e; display: flex; align-items: center; justify-content: center; gap: 7px; }
.eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: #6f9277; }
h1 { font-family: 'Manrope', sans-serif; font-size: clamp(32px, 7.7vw, 44px); line-height: 1.2; letter-spacing: -1.8px; font-weight: 750; margin: 16px 0 14px; }
.intro p { font-size: 14px; color: #7b817b; margin: 0; }
.exercise { max-width: 432px; margin: auto; padding: 24px; background: #fff; border: 1px solid #e9e9e1; border-radius: 23px; box-shadow: 0 8px 32px #333b2410; text-align: center; }
.card-top { display: flex; justify-content: space-between; align-items: center; font-size: 9px; letter-spacing: 1.5px; font-weight: 700; color: #8a9089; }
#category-screen { max-width: 600px; padding: 30px 24px; background: linear-gradient(155deg, #fffefa, #faf8f2); border-color: #e9e5da; box-shadow: 0 10px 32px #544a3010; }
.category-heading { font-size: 25px; letter-spacing: -.7px; margin: 2px 0 12px; }
#category-screen .prompt { color: #85877b; line-height: 1.7; margin-bottom: 26px; }
.category-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.category-option { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; width: 100%; min-width: 0; min-height: 146px; padding: 22px 12px; border: 1px solid #e8e5da; border-radius: 18px; background: #fffefa; color: #35473b; box-shadow: 0 3px 9px #544a3008; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease; }
.category-icon { display: grid; place-items: center; flex-shrink: 0; width: 50px; height: 50px; border-radius: 16px; background: #eeede7; color: #7b8071; }
.category-icon svg { display: block; width: 27px; height: 27px; }
.category-icon-all { background: #e9f1e6; color: #648269; }
.category-icon-house { background: #f5ecdb; color: #a4844e; }
.category-icon-cup { background: #f8e9e5; color: #b77770; }
.category-icon-chair { background: #e8eef5; color: #6a88a8; }
.category-name { font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; max-width: 100%; }
@media (hover: hover) { .category-option:hover { transform: translateY(-3px); border-color: #cbd6c5; background: #fff; box-shadow: 0 8px 18px #544a3010; } }
.category-option:active { transform: scale(.97); box-shadow: 0 1px 4px #544a3008; }
@media (min-width: 760px) { #category-screen { padding: 32px; } .category-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 360px) { #category-screen { padding: 24px 18px; } .category-list { gap: 10px; } .category-option { padding: 18px 8px; } }
@media (prefers-reduced-motion: reduce) { .category-option:hover, .category-option:active { transform: none; } }
.category-status { margin: 16px 0 0; color: #7b817b; font-size: 12px; line-height: 1.6; }
.category-status:empty { display: none; }
.category-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 11px; color: #7b817b; }
.category-navigation button { flex-shrink: 0; min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: #43866d; font-size: 12px; }
#quiz-category { min-width: 0; overflow-wrap: anywhere; text-align: right; }
#counter { letter-spacing: 1px; font-size: 11px; color: #626d64; font-variant-numeric: tabular-nums; }
.progress { height: 3px; background: #eef0e9; margin-top: 14px; border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: #73957c; transition: width .3s; }
.object-stage { position: relative; display: grid; place-items: center; height: 190px; margin-top: 12px; }
.stage-ring { position: absolute; width: 166px; height: 166px; border-radius: 50%; background: #f6f6f2; }
.object { position: relative; width: 216px; height: 180px; isolation: isolate; }
.object img { display: block; width: 100%; height: 100%; object-fit: contain; filter: grayscale(1); }
/* Color blending preserves the grayscale image's luminance and detail.
   The alpha mask confines the tint to the object; isolation keeps the stage out of the blend. */
.object-color { position: absolute; inset: 0; background: var(--article-color); -webkit-mask: var(--object-mask) center / contain no-repeat; mask: var(--object-mask) center / contain no-repeat; mask-mode: alpha; mix-blend-mode: color; opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.object.correct .object-color { opacity: 1; }
h2 { font-family: 'Manrope', sans-serif; font-size: 35px; font-weight: 750; letter-spacing: -1px; margin: 1px 0 8px; }
.prompt { margin: 0 0 23px; color: #90958e; font-size: 12px; }
.articles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.article { border-radius: 13px; height: 62px; font-size: 24px; font-weight: 650; border: 1px solid; transition: background .15s, transform .15s; }
.der { color: var(--blue); background: #edf4fe; border-color: #d8e7fa; }
.die { color: var(--red); background: #fff0f1; border-color: #f6dce0; }
.das { color: var(--green); background: #ecf7f1; border-color: #d6ebdf; }
.article:active:not(:disabled) { transform: scale(.95); }
.article.selected { color: white; background: var(--article-color); border-color: var(--article-color); }
.article:disabled { cursor: default; }
.feedback-area { min-height: 51px; padding-top: 18px; }
#feedback { margin: 0; font-size: 11px; color: #93998f; line-height: 1.6; }
#feedback.wrong { color: #b64954; font-size: 14px; font-weight: 600; }
#feedback.right { color: #358260; font-size: 14px; font-weight: 600; }
.next { width: 100%; margin-top: 14px; background: #293f33; border: 0; color: white; padding: 15px 20px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.next span { float: right; }
[hidden] { display: none !important; }
footer { text-align: center; font-size: 11px; color: #7f887c; line-height: 1.9; margin-top: 26px; }
footer span:last-child { color: #a0a69b; font-size: 10px; }
.footer-mark { color: #79917b; margin-right: 5px; }
@media (min-width: 640px) { .app { padding: 36px 40px; } .intro { margin-top: 52px; } .exercise { padding: 25px 30px; } .object-stage { height: 200px; } }
@media (max-width: 360px) { .app { padding: 20px 16px; } .exercise { padding: 20px; } .eyebrow { font-size: 8px; letter-spacing: 1px; } .intro { margin-top: 34px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
