/* Material-only pass: keep control bounds, labels and interaction modes unchanged. */
body.stage-theme {
  --clay-grain: url('/stage/clay-grain.webp');
  --paper-grain: url('/stage/paper-grain.webp');
  --clay-raised: inset 0 2px 3px #ffffff8c, inset 1px 0 2px #ffffff4d,
    inset 0 -3px 4px #64402526, 0 3px 0 #65513d73, 0 5px 7px #3d2e2524;
  --clay-pressed: inset 0 2px 3px #56351d30, inset 0 -1px 2px #ffffff66,
    0 1px 0 #65513d59;
}

/* Background images do not replace the existing semantic background colors. */
.stage-theme :is(.menu-btn, .title-gallery-button, .title-sound-button,
  .reference-back, .reference-back-button, .reference-footer-action,
  .reference-action-button, .complete-btn, .match-primary-action,
  .match-secondary-action, .gallery-back-button, .save-button, .back-button,
  .command-icon-btn, .tool-btn, .mobile-builder-tools-toggle,
  .mobile-builder-toolbar-close, .dialog-button),
.stage-theme .sculpt-lab-ui button,
.stage-theme .answer-submit-form button {
  background-image: var(--clay-grain) !important;
  background-size: 192px 192px;
  background-blend-mode: multiply;
  border-color: #8061478c;
  box-shadow: var(--clay-raised);
  text-shadow: 0 1px 0 #ffffff38;
}

.stage-theme .menu-btn {
  border-radius: 10px;
  box-shadow: inset 0 3px 4px #ffffff80, inset 2px 0 3px #ffffff3d,
    inset 0 -5px 6px #75432226, 0 5px 0 #73533b80, 0 8px 10px #3d2e2530;
}

.stage-theme :is(.reference-header-title, .speech-bubble,
  .match-phase-heading, .gallery-title, .gallery-heading, .reference-title) {
  background-image: var(--paper-grain) !important;
  background-size: 256px 256px;
  background-blend-mode: multiply;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px #836f4d26, inset 0 1px 0 #ffffffc7,
    1px 3px 0 #e6d4b8, 2px 5px 5px #342c2433;
}

.stage-theme :is(.craft-badge, .answer-time-box strong, .results-total-label #timer) {
  background-image: var(--clay-grain) !important;
  background-size: 192px 192px;
  background-blend-mode: multiply;
  border-radius: 8px;
  box-shadow: var(--clay-raised);
}

.stage-theme .title-screen .name-input,
.stage-theme .answer-submit-form input {
  background-image: var(--paper-grain);
  background-size: 256px 256px;
  background-blend-mode: multiply;
  box-shadow: inset 0 2px 3px #78654d1a, 0 2px 0 #fff8e68c;
}

/* A shallower edge keeps the densely packed sculpting tools legible. */
.stage-theme .sculpt-lab-ui button,
.stage-theme .command-icon-btn {
  box-shadow: inset 0 1px 2px #ffffffa6, inset 0 -2px 2px #6440251f,
    0 2px 0 #65513d40;
}
.stage-theme .sculpt-lab-ui button:is(.is-active, [aria-pressed="true"]) {
  box-shadow: var(--clay-pressed);
}
.stage-theme .sculpt-lab-ui .sculpt-lab-symmetry button[data-lab-axis="x"][aria-pressed="true"] { background-color: #ef8292; }
.stage-theme .sculpt-lab-ui .sculpt-lab-symmetry button[data-lab-axis="y"][aria-pressed="true"] { background-color: #a6ce6a; }
.stage-theme .sculpt-lab-ui .sculpt-lab-symmetry button[data-lab-axis="z"][aria-pressed="true"] { background-color: #89c6ed; }

@media (hover: hover) and (pointer: fine) {
  .stage-theme :is(.menu-btn, .reference-back, .reference-footer-action,
    .complete-btn, .match-primary-action, .match-secondary-action,
    .title-gallery-button):not(:disabled):hover {
    transform: translateY(-1px);
  }
}
.stage-theme :is(.menu-btn, .title-gallery-button, .title-sound-button,
  .reference-back, .reference-back-button, .reference-footer-action,
  .reference-action-button, .complete-btn, .match-primary-action,
  .match-secondary-action, .gallery-back-button, .save-button, .back-button,
  .command-icon-btn, .tool-btn, .mobile-builder-tools-toggle,
  .mobile-builder-toolbar-close, .dialog-button):not(:disabled):active,
.stage-theme .sculpt-lab-ui button:not(:disabled):active,
.stage-theme .answer-submit-form button:not(:disabled):active {
  transform: translateY(2px);
  box-shadow: var(--clay-pressed);
}
.stage-theme button:disabled { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .stage-theme button { transition: none; }
}
