@layer bespoke {
/* Nine-slice borders preserve the stepped corners as translated content grows. */
:root {
  --ui-paper: #fff4df;
  --ui-light: #fff8eb;
  --ui-frame: url("ui/panel.svg");
  --ui-secondary-frame: url("ui/secondary.svg");
  --ui-card-frame: url("ui/card.svg");
  --ui-primary-frame: url("ui/button.svg");
  --ui-selected-frame: url("ui/selected.svg");
}
body.play-screen button {
  border: 8px solid transparent;
  border-image: var(--ui-primary-frame) var(--ui-slice,12) fill / 8px stretch;
  border-radius: 0;
  background: transparent;
  padding: 8px 14px;
  box-shadow: 0 3px 0 #c66a7b;
  text-shadow: 0 1px #fff3be66;
}
body.play-screen button.quiet {
  border-image-source: var(--ui-secondary-frame);
  background: transparent;
  box-shadow: 0 3px 0 #bca2ce;
}
body.play-screen :is(button[aria-pressed="true"], button[aria-selected="true"], .match-grid button.selected) {
  border-image-source: var(--ui-selected-frame);
  background: transparent;
  color: var(--ui-ink);
  box-shadow: 0 3px 0 var(--ui-shadow);
}
body.play-screen button:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--ui-shadow);
}
body.play-screen :is(#panel:not(.course-board,.lesson-panel,.review-panel,.lesson-result,.review-result),
  #language-picker, #seed-picker, #weather-details, #world-word-card, .farm-controls-content) {
  border: 12px solid transparent;
  border-image: var(--ui-frame) var(--ui-slice,12) fill / 12px stretch;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 4px 0 #a68cc7) drop-shadow(0 3px 0 #7865a5) drop-shadow(0 12px 10px #382d5233);
}
body.play-screen :is(.barn-heading, .orders-heading, .shop-heading) {
  padding: 10px 44px 16px 6px;
}
body.play-screen :is(.barn-heading,.orders-heading,.shop-heading) .eyebrow {
  display: block;
  margin: 0 8px 8px;
  color: var(--ui-muted);
  letter-spacing: .14em;
}
body.play-screen :is(.barn-heading h2,.orders-heading h2,.shop-heading h2,
  .settings-heading h2,.garden-heading h2,.vquestion-heading h2,.seed-picker-header strong) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 5px 12px;
  border: 10px solid transparent;
  border-image: var(--ui-secondary-frame) var(--ui-slice,12) fill / 10px stretch;
  font-size: 24px;
  line-height: 1.1;
  filter: drop-shadow(0 2px 0 #c6a7d0);
}
body.play-screen :is(.barn-heading h2,.seed-picker-header strong)::before {
  content: "";
  flex: none;
  width: 32px;
  height: 36px;
  background: url("ui/pouch.svg") center / contain no-repeat;
}
body.play-screen .settings-heading h2::before {
  content: "";
  flex: none;
  width: 28px;
  height: 28px;
  background: url("ui/gear.svg") center / contain no-repeat;
}
body.play-screen :is(#close-panel,#language-back,#seed-picker-close) {
  border: 8px solid transparent;
  border-image: var(--ui-secondary-frame) var(--ui-slice,12) fill / 8px stretch;
  background: transparent;
  color: var(--ui-ink);
  border-radius: 0;
  box-shadow: 0 3px 0 #a68cc7;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}
body.play-screen :is(.barn-card,.order-card,.shop-animal,.shop-land,.shop-field,
  .shop-upgrade,.shop-crop,.decoration-card,.notebook-word,.seed-choice,
  .language-picker-grid button,.settings-profile-card,.settings-language) {
  border: 8px solid transparent;
  border-image: var(--ui-card-frame) var(--ui-slice,12) fill / 8px stretch;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 3px 0 #d2b6d4;
}
body.play-screen :is(.seed-choice[aria-pressed="true"],.language-picker-grid button[aria-pressed="true"]) {
  border-image-source: var(--ui-selected-frame);
  background: transparent;
}
body.play-screen :is(.barn-total,.shop-balance,.course-streak-note) {
  border: 8px solid transparent;
  border-image: var(--ui-secondary-frame) var(--ui-slice,12) fill / 8px stretch;
  background: transparent;
  border-radius: 0;
  padding: 6px 10px;
}
body.play-screen .barn-grid { gap: 14px; padding: 4px 0 12px; }
body.play-screen .barn-card { padding: 10px 4px; }
body.play-screen .barn-art {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  background: #ffe8d2;
  border-radius: 14px;
  box-shadow: inset 0 -3px #edc6cd, inset 0 3px #fff9e4;
}
body.play-screen .barn-quantity {
  border: 6px solid transparent;
  border-image: var(--ui-selected-frame) var(--ui-slice,12) fill / 6px stretch;
  background: transparent;
  color: var(--ui-ink);
  border-radius: 0;
  right: -10px;
  bottom: -4px;
}
body.play-screen .barn-card button { padding: 4px 0; border-width: 6px; border-image-width: 6px; }
body.play-screen #panel.settings-panel { padding-top: 82px; }
body.play-screen .settings-heading { top: 6px; left: 10px; right: 48px; height: 64px; }
body.play-screen #panel.settings-panel > #panel-content { max-height: calc(86dvh - 112px); padding: 4px 12px 20px; }
body.play-screen .settings-section { margin-top: 22px; }
body.play-screen .settings-section h3 { gap: 10px; padding-bottom: 8px; border-bottom: 2px solid #edc5bf; }
body.play-screen .settings-section-icon { background: transparent; color: var(--ui-shadow); }
body.play-screen :is(.interface-languages button,.voice-speeds button) {
  border-image-source: var(--ui-secondary-frame);
  background: transparent;
  color: var(--ui-ink);
  box-shadow: 0 2px 0 #c5a9cf;
}
body.play-screen :is(.interface-languages,.voice-speeds) [aria-pressed="true"] {
  border-image-source: var(--ui-selected-frame);
  box-shadow: 0 3px 0 var(--ui-shadow);
}
body.play-screen .settings-switches { background: transparent; border: 0; }
body.play-screen .preference-switch {
  background: transparent;
  border: 0;
  border-image: none;
  border-radius: 0;
  box-shadow: none;
  padding: 12px 4px;
}
body.play-screen .preference-switch + .preference-switch { border-top: 2px solid #edc5bf; }
body.play-screen .preference-switch > svg { color: var(--ui-shadow); }
body.play-screen .switch-track {
  border: 2px solid #c58a70;
  border-radius: 9px;
  background: #dbcce4;
  box-shadow: inset 0 2px #a68cc7, 0 2px #fff9e4;
}
body.play-screen .preference-switch[aria-checked="true"] .switch-track {
  background: #ffbd37;
  box-shadow: inset 0 2px #ffe5a2, 0 2px #d58e42;
}
body.play-screen .switch-track span {
  background: #fff9e4;
  border: 1px solid #f2c3ac;
  border-radius: 6px;
  box-shadow: 0 2px #bd9cbe;
}
body.play-screen .shop-tabs { background: transparent; padding: 0; gap: 6px; margin-top: 16px; }
body.play-screen .shop-tabs button { border-image-width: 7px; border-width: 7px; }
body.play-screen .seed-picker-header strong { font-size: 21px; }
body.play-screen #seed-picker { padding: 8px; }
body.play-screen #seed-picker-options { padding: 12px 4px 8px; gap: 12px; }
body.play-screen :is(.hud-progress,.game-hud .stats > *, .actions button, .scene-label button,
  .camera-controls button,.map-shortcuts button,#seed-pouch-open,#farm-controls>summary,.region-controls) {
  border: 8px solid transparent;
  border-image: var(--ui-secondary-frame) var(--ui-slice,12) fill / 8px stretch;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 3px 0 #ac8ec4;
}
body.play-screen .game-hud .stats > * { padding: 4px 6px; }
body.play-screen .actions button { padding: 0; }
body.play-screen .actions button:first-child { border-image-source: var(--ui-primary-frame); }
body.play-screen .course-header { background: #fff4df; border-bottom: 4px solid #c3a6d4; }
body.play-screen .course-scroll { background-color: #e9def2; background-image: none; }
body.play-screen .course-topic-banner {
  border: 12px solid transparent;
  border-image: var(--ui-frame) var(--ui-slice,12) fill / 12px stretch;
  background: transparent;
  border-radius: 0;
  box-shadow: 0 4px 0 #bfa2cf;
}
body.play-screen .course-node {
  border: 10px solid transparent;
  border-image: var(--ui-selected-frame) var(--ui-slice,12) fill / 10px stretch;
  background: transparent;
  border-radius: 0;
  box-shadow: 0 5px 0 #a68cc7;
}
body.play-screen .course-node[data-course-state="next"] { border-image-source: var(--ui-primary-frame); background: transparent; }
body.play-screen .course-node[data-course-state="done"] { border-image-source: var(--ui-frame); background: transparent; }
@media (max-width: 639px) {
  body.play-screen :is(.barn-heading h2,.orders-heading h2,.shop-heading h2,.settings-heading h2) { font-size: 21px; padding-inline: 4px; }
  body.play-screen :is(.barn-scroll,.orders-scroll,.shop-scroll) { padding-inline: 6px; }
  body.play-screen .game-hud { inset-inline: 10px; gap: 8px; }
  body.play-screen .hud-progress { padding: 4px 6px; }
}
body.play-screen :is(.barn-view,.orders-view,.shop-view) { max-height: calc(86dvh - 24px); }
body.play-screen .language-picker-shell { max-height: calc(90dvh - 24px); }
body.play-screen .actions #learn-open { border-image-source: var(--ui-primary-frame); }
body.play-screen .level-up-panel {
  border: 12px solid transparent;
  border-image: var(--ui-frame) var(--ui-slice,12) fill / 12px stretch;
  background: transparent;
  border-radius: 0;
}
body.play-screen :is(.correct-answer,.match-grid button.matched,.review-choice.right,.review-choice.reveal,
  .vquestion-answers [data-answer-state="right"],.vquestion-answers [data-answer-state="reveal"]) {
  border-image-source: url("ui/success.svg");
  background: transparent;
  color: #294f29;
}
body.play-screen :is(.wrong-answer,.match-grid button[aria-invalid="true"],.review-choice.wrong,
  .vquestion-answers [data-answer-state="wrong"],button.danger) {
  border-image-source: url("ui/error.svg");
  background: transparent;
  color: #86223c;
}
body.play-screen button { background-clip: padding-box; }
body.play-screen :is(input:not([type="checkbox"]):not([type="range"]),select,textarea) {
  border: 8px solid transparent;
  border-image: var(--ui-secondary-frame) var(--ui-slice,12) fill / 8px stretch;
  border-radius: 0;
  background: transparent;
  min-height: 44px;
}
body.play-screen button.preference-switch { border-image: none; box-shadow: none; }
@media (max-width: 359px) {
  body.play-screen .map-shortcuts { top: 188px; }
  body.play-screen .seed-picker-header strong {
    font-size: 18px;
    gap: 6px;
    padding: 3px 6px;
    border-width: 8px;
    border-image-width: 8px;
  }
  body.play-screen .seed-picker-header strong::before { width: 24px; height: 28px; }
}

}
