/* The studio fills the viewport below the header; the collection has its own view. */
.bean-app[data-craft-phase="home"] { display: flex; flex-direction: column; }
.bean-app[data-craft-phase="home"] .bean-topbar { flex-shrink: 0; }
.bean-topbar { padding-inline: clamp(16px, 2vw, 32px); }
.bean-welcome {
    display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch; gap: 0; width: 100%; max-width: none;
    min-height: 0; margin: 0; padding: 0;
    overflow: visible; border: 0; border-radius: 0;
    background: var(--bean-mat); color: var(--bean-ink); box-shadow: none;
}
.bean-welcome-copy { display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: none; min-width: 0; padding: clamp(24px, 4vh, 64px) clamp(32px, 6vw, 144px); }
.bean-welcome .bean-eyebrow { padding: 0; border: 0; border-radius: 0; background: none; color: #84613a; font-size: 13px; letter-spacing: .08em; }
.bean-welcome h2 { margin: 16px 0 14px; font-size: clamp(48px, min(5.2vw, 8.8vh), 96px); line-height: 1.08; color: #283b37; letter-spacing: -.025em; text-shadow: none; }
.bean-welcome p { max-width: none; margin: 0; color: #626a60; font-size: 16px; line-height: 1.65; }
.bean-first-steps { display: grid; gap: 16px; margin: 28px 0; padding: 0; list-style: none; }
.bean-first-steps li { display: flex; align-items: flex-start; gap: 14px; }
.bean-first-steps li::before { display: none; }
.bean-first-steps li > span { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border: 1px solid #c6b594; border-radius: 50%; color: #8c6430; font-size: 12px; font-variant-numeric: tabular-nums; }
.bean-first-steps strong { color: #2d3c35; font-size: 18px; font-weight: 700; }
.bean-first-steps p { margin-top: 3px; font-size: 14px; }
.bean-topic-picker { border-top: 1px solid #d6cbb8; margin-bottom: 12px; }
.bean-topic-picker summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 48px; cursor: pointer; color: #696354; font-size: 13px; list-style: none; }
.bean-topic-picker summary::-webkit-details-marker { display: none; }
.bean-topic-picker summary strong { color: #36473c; font-weight: 600; }
.bean-topic-change { margin-left: auto; color: #876023; }
.bean-topic-picker[open] .bean-topic-change > span { display: inline-block; transform: rotate(180deg); }
.bean-topic-picker .bean-category-choices { margin: 4px 0 16px; }
.bean-welcome-controls > .bean-primary-button { width: 100%; min-height: 54px; font-size: 17px; }
.bean-welcome-controls .bean-craft-rule-note { margin: 12px 0 0; text-align: center; color: #706552; font-size: 12px; }
.bean-craft-rule-note strong { font-weight: 600; }
.bean-welcome-links { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 12px; }
.bean-welcome-links button { min-height: 44px; min-width: 44px; padding: 4px 0; border: 0; background: transparent; color: #655b47; cursor: pointer; font-size: 13px; text-underline-offset: 5px; }
.bean-welcome-links button:hover { color: #283b37; text-decoration: underline; }
.bean-welcome-art.bean-workshop-scene {
    position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center;
    width: 100%; min-width: 0; margin: 0; padding: 40px 24px 24px; overflow: hidden;
    border: 0; border-radius: 0; background: radial-gradient(ellipse at 50% 40%, #46515f 0%, transparent 65%), #242e40;
    box-shadow: none; transform: none; animation: none; color: #f7e7c9;
}
.bean-workshop-scene::before, .bean-workshop-scene::after { display: none; }
.bean-workshop-scene:hover { box-shadow: none; transform: none; }
.bean-scene-heading { position: relative; z-index: 1; text-align: center; }
.bean-scene-heading > span { color: #cabba3; font-size: 13px; letter-spacing: .12em; }
.bean-welcome #beanWorkshopGreeting { margin: 10px 0 0; font-size: 24px; font-weight: 600; color: #fff1d9; }
.bean-workshop-cat-wrap { position: relative; width: 100%; max-width: min(40vw, calc(100dvh - 360px), 760px); margin: 18px auto 0; padding-bottom: 52px; }
#beanWorkshopCat { display: block; width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 18px 22px #10162355); }
.bean-example-board { position: absolute; width: 43%; bottom: 0; left: -3%; padding: 10px; margin: 0; border: 6px solid #ac8355; border-radius: 8px; background: #faf3e2; color: #6a573d; box-shadow: 0 14px 24px #0a102c40; transform: rotate(-7deg); }
.bean-example-board canvas { width: 100%; height: auto; display: block; background-image: radial-gradient(#d2c7b2 1px, transparent 1px); background-size: 10px 10px; }
.bean-example-board figcaption { text-align: center; margin-top: 4px; font-size: 11px; }
.bean-scene-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; width: min(100%, 640px); margin-top: 32px; padding-top: 20px; border-top: 1px solid #e9c78c26; color: #dacdb5; font-size: 12px; }
.bean-welcome:not([hidden]) .bean-welcome-copy > *, .bean-welcome:not([hidden]) .bean-workshop-scene { animation: none; opacity: 1; transform: none; }
.bean-app[data-craft-phase="home"] .bean-total-score, .bean-app[data-craft-phase="gallery"] .bean-total-score, .bean-app[data-craft-phase="polishing"] .bean-total-score { visibility: hidden; }
.bean-workshop-collection { width: calc(100% - 64px); max-width: 1180px; margin: 32px auto; color: #f4eadc; }
.bean-workshop-collection[hidden] { display: none; }
.bean-collection-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid #ffffff20; }
.bean-collection-heading h2 { margin: 0; color: #fff1d9; font-size: 28px; }
.bean-collection-heading p { margin: 8px 0 0; font-size: 14px; color: #c9c5c1; }
.bean-collection-heading > span { margin-left: auto; color: #e4d2b0; font-variant-numeric: tabular-nums; }
.bean-gallery-body { min-height: 0; padding: 24px 4px 4px; margin: 0 -4px; }
.bean-craft-drafts { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 24px; }
.bean-craft-drafts[hidden] { display: none; }
.bean-craft-drafts button { min-height: 44px; font-size: 13px; padding: 10px 12px; }
.bean-drafts-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; }
.bean-drafts-toggle[hidden] { display: none; }
.bean-drafts-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform 160ms ease; }
.bean-drafts-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
#beanWorkshopStatus:empty { display: none; }
#beanWorkshopStatus { color: #f6d590; margin: 0 0 16px; }
.bean-workshop-wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 24px; padding-top: 24px; }
.bean-workshop-wall:empty { display: none; }
.bean-wall-piece { position: relative; min-width: 0; text-align: left; color: #344135; background: #fff9ec; cursor: pointer; transition: translate 180ms ease; }
.bean-wall-piece:hover { translate: 0 -3px; }
.bean-wall-piece strong { font-size: 16px; }
.bean-wall-piece span { font-size: 13px; }
#beanGalleryEmpty { padding: 48px 0; text-align: center; }
#beanGalleryEmpty[hidden] { display: none; }
#beanGalleryEmpty strong { color: #fff1d9; font-size: 22px; }
#beanGalleryEmpty p { color: #c9c5c1; font-size: 14px; margin: 16px 0 24px; }
@media (min-width: 821px) and (max-height: 800px) {
    .bean-welcome-copy { padding: 24px 36px 16px; }
    .bean-welcome h2 { font-size: 46px; margin-block: 10px; }
    .bean-first-steps { gap: 10px; margin-block: 20px; }
    .bean-welcome-art.bean-workshop-scene { padding-top: 24px; }
    .bean-workshop-cat-wrap { max-width: 360px; margin-top: 8px; }
    .bean-scene-footer { margin-top: 24px; }
}
@media (max-width: 820px) {
    .bean-welcome { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
    .bean-welcome-copy { order: 0; padding: 28px 24px 16px; }
    .bean-welcome-art.bean-workshop-scene { order: 0; padding-inline: 16px; }
    .bean-workshop-cat-wrap { max-width: 100%; }
    .bean-welcome h2 { font-size: 42px; }
    .bean-welcome #beanWorkshopGreeting { font-size: 20px; }
    .bean-example-board { width: 58%; left: 0; }
    .bean-scene-footer { gap: 12px; }
    .bean-workshop-collection { width: calc(100% - 32px); margin-block: 20px; }
    .bean-collection-heading { gap: 16px; }
}
@media (max-width: 560px) {
    .bean-welcome { position: relative; display: block; }
    .bean-welcome-copy { position: relative; z-index: 2; justify-content: flex-start; padding: 28px 24px calc(16px + env(safe-area-inset-bottom)); }
    .bean-welcome-intro { padding-right: 120px; min-height: 158px; }
    .bean-welcome h2 { margin: 12px 0; font-size: 36px; line-height: 1.1; }
    .bean-welcome-intro > p { font-size: 13px; }
    .bean-welcome .bean-eyebrow { font-size: 11px; letter-spacing: 0; }
    .bean-first-steps { margin: 20px 0 16px; gap: 12px; }
    .bean-first-steps li { gap: 10px; }
    .bean-first-steps strong { font-size: 15px; }
    .bean-first-steps p { font-size: 12px; margin-top: 1px; }
    .bean-first-steps li > span { flex-basis: 28px; height: 28px; font-size: 11px; }
    .bean-welcome-art.bean-workshop-scene { position: absolute; z-index: 1; top: 36px; right: 18px; width: 126px; padding: 0; overflow: visible; background: transparent; pointer-events: none; }
    .bean-workshop-cat-wrap { width: 126px; margin: 0; padding: 0; }
    .bean-example-board { bottom: -14px; left: 0; width: 62px; border-width: 3px; padding: 3px; }
    .bean-example-board figcaption, .bean-scene-heading, .bean-scene-footer { display: none; }
    .bean-welcome-controls > .bean-primary-button { min-height: 50px; font-size: 16px; }
    .bean-welcome-controls .bean-craft-rule-note { font-size: 11px; margin-top: 10px; }
    .bean-welcome-links { gap: 24px; margin-top: 8px; }
    .bean-collection-heading > div { flex-basis: 100%; order: 1; }
    .bean-collection-heading h2 { font-size: 24px; }
    .bean-collection-heading > span { font-size: 13px; }
    #beanGalleryEmpty { padding-block: 32px; }
    #beanGalleryEmpty strong { font-size: 18px; }
}
@media (min-width: 821px) and (max-height: 720px) {
    .bean-welcome-copy { padding: 20px 30px 12px; }
    .bean-welcome h2 { font-size: 40px; }
    .bean-welcome h2 br { display: none; }
    .bean-first-steps { margin-block: 16px; gap: 8px; }
    .bean-first-steps li { align-items: center; }
    .bean-first-steps li > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
    .bean-first-steps strong { font-size: 14px; }
    .bean-first-steps p { margin: 0; font-size: 12px; }
    .bean-workshop-cat-wrap { max-width: 270px; padding-bottom: 30px; }
    .bean-scene-footer { margin-top: 16px; padding-top: 16px; }
    .bean-welcome-art.bean-workshop-scene { padding-block: 20px; }
    .bean-welcome #beanWorkshopGreeting { font-size: 20px; }
}
@media (max-width: 560px) and (max-height: 700px) {
    .bean-welcome-copy { padding-top: 20px; }
    .bean-welcome h2 { font-size: 30px; margin-block: 8px; }
    .bean-welcome-intro { min-height: 140px; }
    .bean-first-steps { margin-block: 12px; gap: 8px; }
    .bean-welcome-links { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) { .bean-wall-piece { transition: none; } .bean-wall-piece:hover { translate: none; } }
.bean-craft-finish-bar { display: none; }
@media (min-width: 821px) {
    .bean-stage { border: 1px solid #ffffff30; border-radius: 24px; background: var(--bean-mat); box-shadow: var(--bean-mat-shadow); }
    .bean-board-panel, .bean-ai-panel { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
    .bean-ai-panel { position: static; align-self: stretch; min-height: 0; border-left: 1px solid #d6cbb8; }
}
.bean-app[data-craft-phase="polishing"] .bean-craft-finish-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; margin: 0 0 12px; }
.bean-craft-finish-bar > span { flex: 1 1 200px; font-size: 13px; }
#beanCraftSave { padding: 10px 12px; min-height: 44px; font-size: 13px; }
#beanCraftFinish { min-height: 44px; padding: 10px 16px; }
.bean-app[data-craft-phase="polishing"] .bean-timer > span, .bean-app[data-craft-phase="polishing"] .bean-timer svg { display: none; }
.bean-app[data-craft-phase="polishing"] .bean-timer strong { font-size: 17px; }
.bean-app[data-craft-phase="polishing"] .bean-guess-section, .bean-app[data-craft-phase="polishing"] .bean-score-card, .bean-app[data-craft-phase="polishing"] #beanGiveUpButton { display: none; }
.bean-app[data-craft-phase="polishing"] .bean-budget-bar { display: none; }
.bean-app[data-craft-phase="polishing"] .bean-mobile-budget { visibility: hidden; }
.bean-ai-identity { position: relative; justify-content: center; padding: 0; border: 0; }
.bean-ai-identity > div:last-child { position: absolute; left: 0; top: 0; }
.bean-ai-identity h2 { font-size: 16px; }
.bean-ai-avatar { width: 216px; height: 216px; overflow: visible; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.bean-ai-avatar.is-watching { box-shadow: none; }
#beanAIOnline { display: none; }
.bean-ai-panel { padding-top: 14px; }
.bean-ai-speech { margin-top: 2px; margin-bottom: 14px; }
@media (max-width: 820px) { .bean-guess-list { max-height: 130px; } }
.bean-craft-preview { display: none; position: absolute; width: 32%; left: 4%; top: 67%; background: #fff9e9; border: 5px solid #b28b5a; }
.bean-craft-preview canvas { width: 100%; height: auto; filter: drop-shadow(0 2px 1px #0008); }
.bean-app[data-craft-phase="polishing"] .bean-craft-preview { display: block; }
.bean-app button:focus-visible { outline: 3px solid #3284d1; outline-offset: 3px; }
@media (min-width: 821px) and (max-height: 820px) {
    .bean-ai-avatar { width: 150px; height: 150px; }
    .bean-ai-identity > div:last-child { font-size: 12px; }
    .bean-ai-speech { padding: 12px; }
    .bean-ai-speech p { min-height: 40px; }
    .bean-ai-panel { padding: 12px; min-height: 0; }
    .bean-side-actions { margin-top: 10px; }
    .bean-score-card { margin-top: 10px; }
}
@media (max-width: 820px) {
    .bean-wall-piece { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-height: 98px; }
    .bean-wall-piece canvas { width: 100%; height: auto; }
    .bean-wall-piece strong { align-self: auto; font-size: 13px; }
    .bean-wall-piece span { font-size: 12px; }
    .bean-ai-identity { display: contents; }
    .bean-ai-identity > div:last-child { display: none; }
    .bean-ai-avatar { grid-row: 2; grid-column: 1; order: 2; width: 112px; height: 112px; justify-self: end; align-self: center; margin-right: 3px; z-index: 2; pointer-events: none; }
    .bean-ai-speech { grid-row: 2; grid-column: 1; min-height: 118px; padding: 10px 120px 10px 12px; margin: 0; }
    .bean-speech-avatar { display: none; }
    .bean-ai-speech p { font-size: 14px; margin-bottom: 6px; }
    .bean-speech-label { font-size: 12px; }
    .bean-observe-state { font-size: 11px; }
    .bean-app[data-craft-phase="polishing"] .bean-craft-finish-bar { order: 6; position: static; z-index: 1; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); margin: 0; background: #fff5df; border: 1px solid #c6bda9; border-radius: 12px; }
    .bean-craft-finish-bar > span { flex-basis: 100%; }
    #beanCraftFinish { flex: 1; }
    .bean-app[data-craft-phase="polishing"] .bean-side-actions { order: 7; }
}
@media (prefers-reduced-motion: reduce) {
    .bean-ai-avatar img { animation: none !important; }
    .bean-drafts-toggle svg { transition: none; }
}

@media (max-width: 820px) {
    .bean-app[data-craft-phase="polishing"] .bean-craft-finish-bar { order: 6; }
    .bean-app[data-craft-phase="polishing"] .bean-tools { position: static; }
}

.bean-app[data-craft-phase="polishing"] .bean-count-target { display: none; }
.bean-craft-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0; }
.bean-rules-card { width: min(680px, 100%); }
.bean-rules-card li b, .bean-rules-card li span, .bean-rules-card > p { font-size: 15px; line-height: 1.65; }
.bean-craft-guide figure { margin: 0; min-width: 0; padding: 8px; border: 1px solid #cec2ac; border-radius: 10px; background: #fff8e9; }
.bean-craft-guide figcaption b, .bean-craft-guide figcaption span { display: block; font-size: 14px; line-height: 1.6; }
.bean-craft-guide figcaption span { color: #665e50; margin-top: 4px; }
@media (max-width: 560px) {
    .bean-craft-guide { grid-template-columns: 1fr; }
    .bean-craft-guide figure { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 8px; }
}
@media (max-width: 820px) {
    .bean-app[data-craft-phase="polishing"] .bean-mobile-budget { visibility: visible; }
    .bean-app[data-craft-phase="polishing"] .bean-budget { display: none; }
}

.bean-category-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bean-category-choices button { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 44px; padding: 8px 8px 8px 6px; font-size: 14px; }
.bean-category-choices button::before { content: ""; width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; --bean-tone: var(--bean-choice, #e6ad2f); box-shadow: 0 1.5px 2px rgba(92, 64, 36, 0.3), inset 0 0 0 0.5px rgba(0, 0, 0, 0.14); }
.bean-category-choices button:nth-child(1) { --bean-choice: #e6ad2f; }
.bean-category-choices button:nth-child(2) { --bean-choice: #df4651; }
.bean-category-choices button:nth-child(3) { --bean-choice: #ee8834; }
.bean-category-choices button:nth-child(4) { --bean-choice: #94603e; }
.bean-category-choices button:nth-child(5) { --bean-choice: #3c76d0; }
.bean-category-choices button:nth-child(6) { --bean-choice: #42a06b; }
.bean-category-choices .bean-secondary-button { border-color: #c4b39a; background: linear-gradient(180deg, #f8f1e4, #efe2cf); color: #3a3228; box-shadow: inset 0 2px 4px rgba(90, 70, 40, 0.14); }
.bean-category-choices .bean-secondary-button:hover { border-color: #a8844e; background: #fff8ec; color: #2d2418; transform: none; }
.bean-category-choices .bean-secondary-button[aria-pressed="true"] { border-color: #406a54; background: #e0eadc; color: #243b2b; box-shadow: inset 0 0 0 1px #406a54; }
.bean-category-choices .bean-secondary-button[aria-pressed="true"]::before { box-shadow: inset 0 3px 4px rgba(40, 20, 4, 0.38), 0 0 0 2px rgba(255, 255, 255, 0.55); transform: translateY(1px); }
.bean-wall-piece { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 10px; border: 7px solid #b28b5a; border-radius: 3px; box-shadow: 0 4px 8px #59442c18; }
.bean-wall-piece::before { content: ''; position: absolute; width: 38%; height: 16px; border: 1px solid #b28b5a; border-bottom: 0; border-radius: 40% 40% 0 0; top: -23px; left: 31%; }
.bean-wall-piece canvas { width: 100%; height: auto; aspect-ratio: 1; }
.bean-wall-piece strong, .bean-wall-piece span { align-self: auto; }
.bean-finish-options { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.bean-finish-options button { flex: 1; min-height: 48px; }
.bean-finish-options button[hidden] { display: none; }
.bean-guide-frame { border: 5px solid #b28b5a; background: #fffaf0; }
#beanGalleryEmpty { color: #e6d7c2; line-height: 1.7; }
#beanGalleryMore { margin-top: 18px; min-height: 44px; }
@media (max-width: 820px) {
    .bean-workshop-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
    .bean-wall-piece { padding: 6px; border-width: 5px; }
    .bean-category-choices button { font-size: 14px; }
}
@media (max-width: 380px) {
    .bean-category-choices { gap: 6px; }
    .bean-category-choices button { gap: 4px; padding: 6px 4px; font-size: 13px; }
    .bean-category-choices button::before { width: 14px; height: 14px; flex-basis: 14px; }
}

.bean-craft-guide figure > canvas { width: 100%; aspect-ratio: 180 / 140; object-fit: contain; }

/* Display face: Smiley Sans (SIL OFL 1.1), subset from this page's own fixed copy.
   AI speech, guesses and nicknames stay on the device font. */
@font-face {
    font-family: "Bean Display";
    src: url("/static/fonts/bean-artist/smiley-sans-display-subset.woff2?v=20261115") format("woff2");
    font-display: swap;
    font-weight: 400 900;
    font-style: normal;
}
.bean-app { --bean-display: "Bean Display", "PingFang SC", "Microsoft YaHei", sans-serif; }
.bean-game-title strong,
.bean-welcome h2,
.bean-first-steps strong,
.bean-first-steps li > span,
.bean-welcome #beanWorkshopGreeting,
.bean-round-heading h1,
.bean-timer strong,
.bean-total-score strong,
.bean-ai-identity h2,
.bean-budget strong,
.bean-mobile-budget strong,
.bean-score-card strong,
.bean-result h2,
.bean-result-kicker,
.bean-result-stats strong,
.bean-result-medals span,
.bean-collection-heading h2,
#beanGalleryEmpty strong,
.bean-wall-piece strong,
.bean-rules-card h2,
.bean-craft-guide figcaption b,
.bean-leaderboard-header h2,
.bean-share-header h2,
.bean-app .bean-primary-button {
    font-family: var(--bean-display);
    font-weight: 400;
    font-synthesis: none;
    letter-spacing: .01em;
}
.bean-welcome h2 { line-height: 1.04; letter-spacing: .005em; }
.bean-welcome h2 em { color: #c96a2c; font-style: normal; }
.bean-round-heading h1 { font-size: clamp(30px, 3.2vw, 44px); letter-spacing: .01em; }
.bean-first-steps strong { font-size: 20px; }
.bean-app .bean-primary-button { letter-spacing: .04em; }
.bean-welcome-controls > .bean-primary-button { font-size: 20px; }
.bean-result h2 { letter-spacing: 0; }
.bean-result-kicker { font-size: 14px; letter-spacing: .06em; }
.bean-result-stats strong { font-size: 26px; }
.bean-timer strong { display: inline-block; font-size: 32px; }
.bean-score-card strong { font-size: 22px; }

/* 首页：豆子在台灯下呼吸，招呼语是她说的话，示例小鱼一颗颗拼出来。 */
.bean-welcome #beanWorkshopGreeting {
    position: relative; display: inline-block; margin-top: 14px; padding: 12px 22px 13px;
    border-radius: 22px; background: #fff8ea; color: #2c3a36; font-size: 24px;
    box-shadow: 0 12px 26px rgba(6, 10, 22, .32), inset 0 -3px 0 rgba(170, 130, 80, .18);
    transform-origin: 50% 120%;
}
.bean-welcome #beanWorkshopGreeting::after {
    position: absolute; bottom: -9px; left: 50%; width: 20px; height: 20px;
    border-radius: 0 0 6px 0; background: #fff8ea; content: ""; transform: translateX(-50%) rotate(45deg);
}
.bean-welcome:not([hidden]) #beanWorkshopGreeting { animation: beanBubbleIn 520ms cubic-bezier(.3, 1.5, .5, 1) 260ms both; }
#beanWorkshopCat { transform-origin: 50% 96%; animation: beanCatBreathe 4.8s ease-in-out infinite; transition: rotate 420ms cubic-bezier(.3, 1.4, .5, 1); }
@media (hover: hover) and (pointer: fine) {
    .bean-workshop-cat-wrap:hover #beanWorkshopCat { rotate: -3deg; }
}
.bean-example-board { transition: rotate 420ms cubic-bezier(.3, 1.4, .5, 1); }
.bean-workshop-cat-wrap:hover .bean-example-board { rotate: 3deg; }
.bean-scene-beans { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.bean-scene-beans i {
    --bean-hop-x: 6px;
    position: absolute; width: 16px; aspect-ratio: 1; border-radius: 50%;
    --bean-tone: var(--bean-paint);
    box-shadow: 0 4px 8px rgba(3, 6, 16, .45), inset 0 -1px 1px rgba(255, 255, 255, .24), inset 0 0 0 .5px rgba(0, 0, 0, .16);
    animation: beanWelcomeBeanHop 6s cubic-bezier(.35, .8, .45, 1) infinite;
}
.bean-scene-beans i:nth-child(1) { right: 30%; bottom: 3%; --bean-paint: #df4651; animation-delay: -1.2s; }
.bean-scene-beans i:nth-child(2) { --bean-hop-x: -7px; right: 22%; bottom: 7%; width: 13px; --bean-paint: #f1c73e; animation-duration: 6.8s; animation-delay: -3.4s; }
.bean-scene-beans i:nth-child(3) { right: 8%; bottom: 2%; width: 18px; --bean-paint: #3c76d0; animation-duration: 7.4s; animation-delay: -5.1s; }
.bean-scene-beans i:nth-child(4) { --bean-hop-x: -5px; right: 40%; bottom: 0; width: 12px; --bean-paint: #42a06b; animation-duration: 5.6s; animation-delay: -2.2s; }
.bean-scene-beans i:nth-child(5) { right: 2%; bottom: 14%; width: 14px; --bean-paint: #8351ba; animation-duration: 6.4s; animation-delay: -4.4s; }
.bean-scene-beans i:nth-child(6) { --bean-hop-x: 8px; right: 15%; bottom: -1%; width: 15px; --bean-paint: #ec8cb0; animation-duration: 7s; animation-delay: -0.6s; }
.bean-scene-beans i:nth-child(7) { --bean-hop-x: -6px; right: 48%; bottom: 5%; width: 11px; --bean-paint: #ee8834; animation-duration: 5.2s; animation-delay: -3.9s; }
@keyframes beanCatBreathe {
    0%, 100% { transform: scale(1, 1); }
    50% { transform: scale(1.006, 1.016); }
}
@keyframes beanBubbleIn {
    from { opacity: 0; transform: translateY(10px) scale(.86); }
    to { opacity: 1; transform: none; }
}

/* 局内：豆子观察时偏头看画板，冒出思考豆；猜完用表情和小角标回应。 */
.bean-ai-avatar img { transform-origin: 50% 92%; animation: beanCatBreathe 4.8s ease-in-out infinite; transition: rotate 420ms cubic-bezier(.3, 1.4, .5, 1), translate 420ms cubic-bezier(.3, 1.4, .5, 1); }
.bean-ai-avatar.is-watching img { animation: beanCatBreathe 2.4s ease-in-out infinite; rotate: -6deg; translate: -6px 3px; }
.bean-ai-avatar .bean-cat-thinking {
    position: absolute; z-index: 3; top: 12%; right: auto; bottom: auto; left: 2%; display: flex; gap: 5px;
    width: auto; height: auto; padding: 8px 10px; border: 1px solid rgba(170, 130, 80, .3);
    border-radius: 999px; background: #fff8ea; box-shadow: 0 8px 18px rgba(6, 10, 22, .22);
    opacity: 0; pointer-events: none; transform: translateY(8px) scale(.6); transform-origin: 80% 100%;
    transition: opacity 200ms ease, transform 260ms cubic-bezier(.3, 1.5, .5, 1);
}
.bean-cat-thinking::after {
    position: absolute; right: 4px; bottom: -9px; width: 9px; height: 9px; border-radius: 50%;
    background: #fff8ea; box-shadow: 0 4px 8px rgba(6, 10, 22, .18); content: "";
}
.bean-cat-thinking i { width: 9px; height: 9px; border-radius: 50%; background: #df4651; box-shadow: inset 0 0 0 2.5px rgba(0, 0, 0, .22); }
.bean-cat-thinking i:nth-child(2) { background: #f1c73e; }
.bean-cat-thinking i:nth-child(3) { background: #3c76d0; }
.bean-ai-avatar.is-watching .bean-cat-thinking { opacity: 1; transform: none; }
.bean-ai-avatar.is-watching .bean-cat-thinking i { animation: beanThinkHop 900ms ease-in-out infinite; }
.bean-ai-avatar.is-watching .bean-cat-thinking i:nth-child(2) { animation-delay: 150ms; }
.bean-ai-avatar.is-watching .bean-cat-thinking i:nth-child(3) { animation-delay: 300ms; }
@keyframes beanThinkHop { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-5px); } }
.bean-ai-avatar .bean-cat-reaction {
    position: absolute; z-index: 3; top: 6%; right: 10%; bottom: auto; display: grid; place-items: center;
    width: auto; min-width: 38px; height: 38px; padding: 0 8px; border: 2px solid #fff; border-radius: 999px;
    background: var(--bean-sky); color: #fff; font-family: var(--bean-display); font-size: 22px; line-height: 1;
    box-shadow: 0 8px 16px rgba(6, 10, 22, .28); opacity: 0; pointer-events: none;
}
.bean-ai-avatar .bean-cat-reaction[data-mood="close"] { background: #d98a16; }
.bean-ai-avatar .bean-cat-reaction[data-mood="correct"] { background: var(--bean-green); }
.bean-scene-heading > span { display: block; }
.bean-ai-identity > div:last-child {
    top: auto; bottom: 8px; left: -4px; z-index: 2; padding: 6px 11px 7px;
    border: 1px solid rgba(170, 130, 80, .34); border-radius: 12px; background: #fff8ea;
    box-shadow: 0 6px 14px rgba(36, 30, 20, .14); rotate: -4deg;
}
.bean-ai-identity > div:last-child span { display: block; font-size: 10px; }
.bean-ai-identity h2 { margin: 1px 0 0; font-size: 18px; }
.bean-ai-speech::before { left: 50%; margin-left: -8px; }

/* 画板：豆子落下时有轻微下压，读秒最后十秒数字跳动，猜中时彩豆从命中格迸开。 */
.bean-board-cell[data-color]:not([data-color="0"])::after { animation: beanDrop 240ms cubic-bezier(.3, 1.45, .5, 1) both; }
.bean-board-cell.is-hit[data-color]:not([data-color="0"])::after { animation: beanHit 650ms ease 2; }
@keyframes beanDrop {
    0% { opacity: 0; transform: translate(-50%, -88%) scale(1.3); }
    62% { opacity: 1; transform: translate(-50%, -50%) scale(1.1, .9); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.bean-timer[data-state="urgent"] strong { animation: beanTimerBeat 1s ease-in-out infinite; }
@keyframes beanTimerBeat { 0%, 100% { transform: none; } 18% { transform: scale(1.16); } 36% { transform: none; } }
.bean-burst { position: absolute; z-index: 4; inset: 0; overflow: visible; pointer-events: none; }
.bean-burst i {
    position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
    --bean-tone: var(--bean-paint);
    box-shadow: 0 3px 6px rgba(6, 10, 22, .3);
}

/* 结算：豆子本人来宣布结果。 */
.bean-result-summary { position: relative; }
.bean-result-cat {
    position: absolute; top: -26px; right: -12px; width: 132px; height: auto; pointer-events: none;
    filter: drop-shadow(0 12px 14px rgba(36, 30, 20, .22)); transform-origin: 50% 100%;
}
.bean-result-kicker, .bean-result h2 { padding-right: 112px; }
.bean-result:not([hidden]) .bean-result-card { animation: beanResultIn 460ms cubic-bezier(.2, .9, .3, 1.12) both; }
.bean-result:not([hidden]) .bean-result-cat { animation: beanResultCatIn 620ms cubic-bezier(.3, 1.5, .5, 1) 200ms both; }
.bean-result:not([hidden]) h2 { animation: beanStampIn 420ms cubic-bezier(.3, 1.5, .5, 1) 140ms both; }
.bean-result:not([hidden]) .bean-result-stats > div { animation: beanStatIn 380ms ease-out both; }
.bean-result:not([hidden]) .bean-result-stats > div:nth-child(2) { animation-delay: 80ms; }
.bean-result:not([hidden]) .bean-result-stats > div:nth-child(3) { animation-delay: 160ms; }
.bean-result:not([hidden]) .bean-result-stats > div:nth-child(4) { animation-delay: 240ms; }
.bean-result h2 { transform-origin: 0 70%; }
@keyframes beanResultIn { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes beanResultCatIn { 0% { opacity: 0; transform: translateY(34px) scale(.8); } 100% { opacity: 1; transform: none; } }
@keyframes beanStampIn { 0% { opacity: 0; transform: scale(1.22) rotate(-3deg); } 100% { opacity: 1; transform: none; } }
@keyframes beanStatIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 821px) and (max-height: 760px) {
    .bean-ai-avatar .bean-cat-reaction { min-width: 30px; height: 30px; font-size: 18px; }
    .bean-ai-avatar .bean-cat-thinking { padding: 6px 8px; }
    .bean-ai-identity h2 { font-size: 15px; }
}
@media (max-width: 820px) {
    .bean-ai-avatar .bean-cat-thinking { top: -2px; left: -10px; gap: 4px; padding: 6px 7px; }
    .bean-cat-thinking i { width: 7px; height: 7px; }
    .bean-ai-avatar .bean-cat-reaction { top: -4px; right: -2px; min-width: 30px; height: 30px; font-size: 17px; }
    .bean-ai-avatar.is-watching img { rotate: -4deg; translate: -3px 2px; }
}
@media (max-width: 560px) {
    .bean-welcome-intro { padding-right: 136px; }
    .bean-welcome-art.bean-workshop-scene { top: 28px; right: 12px; width: 148px; }
    .bean-workshop-cat-wrap { width: 148px; }
    .bean-example-board { width: 70px; }
    .bean-scene-beans { display: none; }
    .bean-first-steps strong { font-size: 17px; }
    .bean-welcome-controls > .bean-primary-button { font-size: 18px; }
    .bean-result-cat { top: -16px; right: -6px; width: 74px; }
    .bean-result-kicker, .bean-result h2 { padding-right: 66px; }
    .bean-timer strong { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
    #beanWorkshopCat, .bean-ai-avatar img, .bean-scene-beans i, .bean-cat-thinking i { animation: none !important; }
    .bean-ai-avatar.is-watching img { rotate: none; translate: none; }
    .bean-workshop-cat-wrap:hover #beanWorkshopCat, .bean-workshop-cat-wrap:hover .bean-example-board { rotate: none; }
}
