@font-face {
  font-family: 'Luckiest Guy';
  src: url('/assets/luckiest-guy-latin.woff2') format('woff2');
  font-display: swap;
}
body[data-theme='squishy'] {
  background: radial-gradient(ellipse at 12% 15%, #fff5e6, transparent 55%), linear-gradient(135deg, #f7e5f2, #e9e3fb 55%, #d8f0f1);
  color: #513762;
}
.game-shell { max-width: 1240px; padding-bottom: 30px; }
.game-header { margin-bottom: 24px; }
.game-title { font-family: 'Luckiest Guy', Baloo, sans-serif; font-weight: 400; color: #9464b7; font-size: clamp(2.6rem, 5vw, 4rem); -webkit-text-stroke: 4px #fff; text-shadow: 0 5px 0 #64417c; }
.game-toolbar { gap: 10px; }
.game-toolbar .toolbar-button { border-width: 2px; box-shadow: 0 3px 0 #bd9cc8; }
.squishy-workshop { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 24px; align-items: start; }
.squishy-workshop.is-saved { grid-template-columns: minmax(0, 820px); justify-content: center; }
.squishy-preview { position: sticky; top: 8px; }
.squishy-stage {
  position: relative;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 36px;
  background: radial-gradient(ellipse at 30% 25%, #fff8eb 0, transparent 60%), linear-gradient(145deg, #d9edf8, #e4dafa 68%, #efcddd);
  box-shadow: 0 7px 0 #bfb0db, 0 16px 28px #8c72a01a;
}
.toy-heading { position: relative; z-index: 1; padding: 24px 65px 0; text-align: center; pointer-events: none; }
.toy-heading h2 { margin: 0; overflow-wrap: anywhere; font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.15; }
.toy-heading p { margin: 7px 0 0; color: #665273; font-size: 1rem; }
.stage-window { position: relative; height: 405px; }
#squishy-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; outline-offset: -6px; border-radius: 20px; }
#squishy-canvas.is-rotating { cursor: grabbing; }
.view-controls { position: absolute; right: 16px; top: 40px; display: grid; gap: 8px; }
.view-controls button { padding: 0; border: 2px solid #c6b5d6; border-radius: 50%; background: #fffcf3; font-size: 1.7rem; line-height: 1; box-shadow: 0 3px 0 #c6b5d6; }
.stage-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 20px; padding: 0 20px 12px; }
.edit-button, #save-squishy { min-height: 48px; padding: 8px 18px; border: 2px solid #8865a1; border-radius: 16px; background: #f5e7ff; color: #513762; font: inherit; font-weight: 800; box-shadow: 0 3px 0 #8865a1; }
#save-squishy { background: #dcc9f2; }
.customizer-footer { margin-top: 24px; padding-top: 18px; border-top: 1px solid #dfd3e7; }
.clear-style-button { min-height: 48px; padding: 8px 18px; border: 2px solid #ad6c8e; border-radius: 16px; background: #fff2f7; color: #7f325a; font: inherit; font-weight: 700; }
.customizer-footer .clear-style-button { width: 100%; }
.wax-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
#toggle-wax { min-height: 48px; padding: 8px 14px; border: 2px solid #dfd3e7; border-radius: 15px; background: #fcf9ff; }
#wax-color-label { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
#wax-color { width: 48px; height: 48px; padding: 4px; border: 1px solid #c6b5d6; border-radius: 10px; background: #fff; }
#coat-wax { font-size: .9rem; padding-inline: 12px; }
.clear-style-dialog { width: min(420px, calc(100% - 32px)); max-height: calc(100svh - 32px); padding: 24px; border: 3px solid #c6b5d6; border-radius: 24px; background: #fffcf7; color: #513762; font: inherit; box-shadow: 0 12px 40px #38224440; }
.clear-style-dialog::backdrop { background: #38224480; }
.clear-style-dialog h2 { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.clear-style-dialog p { margin: 14px 0; font-size: 1rem; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.dialog-actions button { flex: 1 1 150px; }
.squish-button {
  min-height: 58px;
  padding: 8px 36px;
  border: 3px solid #367841;
  border-radius: 22px;
  background: linear-gradient(#a1ec74, #65cb64);
  color: #214e2a;
  font-family: 'Luckiest Guy', Baloo, sans-serif;
  font-size: 1.6rem;
  box-shadow: inset 0 3px 0 #e3ffc6, 0 5px 0 #367841;
}
.squishy-customizer { max-height: 770px; overflow-y: auto; padding: 0 24px 22px; border-radius: 30px; background: #fffcf7; box-shadow: 0 5px 0 #d5c2de; }
.customizer-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 20px 0 16px; background: #fffcf7; }
.squishy-customizer h2 { margin: 0; font-size: 1.4rem; line-height: 1.2; }
.name-label, legend { font-weight: 800; font-size: 1.05rem; }
.name-label { display: block; margin-bottom: 6px; }
#squishy-name { display: block; width: 100%; min-height: 48px; padding: 8px 12px; border: 2px solid #b7a3c7; border-radius: 13px; background: #fff; color: #513762; font: inherit; }
#squishy-name::placeholder { color: #795c87; opacity: 1; }
fieldset { min-width: 0; margin: 19px 0 0; padding: 0; border: 0; }
legend { margin-bottom: 9px; padding: 0; }
.color-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.color-swatch { display: grid; place-items: center; position: relative; min-width: 0; min-height: 48px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.color-swatch::before { content: ''; position: absolute; width: 32px; height: 32px; border: 2px solid #6c527e66; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 3px 2px #ffffff80; }
.color-swatch span { z-index: 1; font-size: 1.2rem; font-weight: 800; opacity: 0; color: #402750; }
.color-swatch[aria-pressed='true']::before { outline: 2px solid #604279; outline-offset: 3px; }
.color-swatch[aria-pressed='true'] span { opacity: 1; }
.color-crema { --swatch: #ffe6bd; }
.color-rosa { --swatch: #f49cbb; }
.color-lila { --swatch: #b4a0e5; }
.color-cielo { --swatch: #8dd6ea; }
.color-menta { --swatch: #9cddbd; }
.color-durazno { --swatch: #ffb486; }
.face-options, .accessory-options, .decoration-options, .model-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.model-options { grid-template-columns: repeat(4, 1fr); }
.face-options button, .accessory-options button, .model-options button, .decoration-choice button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 72px; padding: 6px 2px; border: 2px solid #dfd3e7; border-radius: 15px; background: #fcf9ff; font-size: .82rem; }
.squishy-customizer button[aria-pressed='true']:not(.color-swatch) { border-color: #9172b6; background: #ede1fa; box-shadow: inset 0 0 0 1px #9172b6; }
.face-icon { font-family: 'Trebuchet MS', sans-serif; font-size: 1.4rem; letter-spacing: -.04em; }
.accessory-icon { font-size: 1.7rem; line-height: 1.1; }
.decoration-choice { min-width: 0; }
.decoration-choice button { width: 100%; }
.decoration-icon { font-size: 1.7rem; line-height: 1.1; color: var(--decoration-color); -webkit-text-stroke: .5px #51376266; }
.decoration-color { display: flex; align-items: center; justify-content: space-between; gap: 3px; margin-top: 4px; font-size: .75rem; }
.decoration-color input { width: 44px; min-width: 44px; height: 44px; padding: 4px; border: 1px solid #c6b5d6; border-radius: 10px; background: #fff; cursor: pointer; }
.accessory-help { margin: 8px 0 0; font-size: .85rem; color: #725d7e; }
.squishy-customizer [aria-pressed] { touch-action: none; cursor: grab; user-select: none; }
.style-in-hand {
  position: fixed; z-index: 15; pointer-events: none; transform: translate(-50%,-85%) rotate(-8deg);
  display: grid; place-items: center; min-width: 50px; height: 50px; padding: 3px 8px;
  border: 3px solid white; border-radius: 18px; background: #fbedff;
  box-shadow: 0 4px 0 #b89dc8, 0 7px 12px #67427852; color: #674278; font-size: 1.7rem;
}
.style-in-hand[hidden] { display: none; }
#squishy-canvas.style-target { outline: 3px dashed #9263ae; outline-offset: -8px; }
#save-status { margin: 0; padding: 5px 18px 18px; color: #425a49; font-size: .85rem; text-align: center; }
#save-status.save-failed { color: #8d393f; }
#retry-render { margin-top: 10px; padding: 8px 15px; background: #f3e3fa; border: 2px solid #8f6fa4; border-radius: 15px; font: inherit; }
.render-error { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; background: #f8effb; }
.render-error img { width: min(280px, 100%); height: auto; max-height: 155px; object-fit: contain; border-radius: 20px; }
.render-error p { max-width: 32ch; margin: 12px 0 0; }
.game-status:empty { display: none; }
.game-status { margin-top: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
  .squishy-workshop { grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
  .squishy-customizer { padding: 0 17px 17px; }
  .squishy-customizer h2 { font-size: 1.2rem; }
  .stage-window { height: 380px; }
  .stage-controls { gap: 14px; }
  .squish-button { padding-inline: 24px; }
}
@media (max-width: 680px) and (orientation: portrait) {
  .game-header { margin-bottom: 18px; }
  .game-title { font-size: 2.6rem; }
  .game-toolbar .toolbar-button { flex-direction: row; font-size: .85rem; }
  .squishy-workshop { --preview-height: clamp(290px, 42svh, 350px); grid-template-columns: 1fr; gap: 22px; }
  .squishy-stage { border-radius: 28px; }
  .toy-heading { padding: 20px 50px 0; }
  .toy-heading p { font-size: .9rem; }
  .stage-window { height: 310px; }
  .stage-controls { padding: 0 12px 12px; gap: 12px; }
  .squish-button { min-height: 54px; font-size: 1.4rem; padding-inline: 25px; }
  .view-controls { right: 10px; top: 26px; }
  .squishy-customizer { max-height: none; overflow: visible; padding: 0 22px 22px; }
  .customizer-heading { top: calc(var(--preview-height) + 18px); border-radius: 0; }
  .squishy-customizer :is(button, input) { scroll-margin-top: calc(var(--preview-height) + 115px); }
  .squishy-workshop:not(.is-saved) .squishy-preview { top: 0; z-index: 3; margin: -8px 0 -10px; padding: 8px 0 10px; background: #eee5f5; }
  .squishy-workshop:not(.is-saved) .squishy-stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; height: var(--preview-height); }
  .squishy-workshop:not(.is-saved) .toy-heading { min-height: 66px; padding: 14px 174px 0 12px; text-align: left; }
  .squishy-workshop:not(.is-saved) .toy-heading h2 { font-size: 1.2rem; }
  .squishy-workshop:not(.is-saved) .toy-heading p { display: none; }
  .squishy-workshop:not(.is-saved) .stage-window { position: static; height: auto; min-height: 0; }
  .squishy-workshop:not(.is-saved) .view-controls { display: flex; top: 10px; right: 10px; gap: 4px; z-index: 2; }
  .squishy-workshop:not(.is-saved) .stage-controls { padding: 0 8px 6px; gap: 8px; }
  .squishy-workshop:not(.is-saved) .squish-button { min-height: 48px; padding: 5px 24px; font-size: 1.2rem; }
  .squishy-workshop:not(.is-saved) #save-status { padding: 3px 12px 8px; font-size: .75rem; }
  .squishy-workshop:not(.is-saved) .render-error { justify-content: flex-start; overflow-y: auto; padding: 8px; }
  .squishy-workshop:not(.is-saved) .render-error img { display: none; }
  .squishy-workshop:not(.is-saved) .render-error p { margin-top: 0; font-size: .8rem; }
  .color-swatch::before { width: 36px; height: 36px; }
  .face-options button, .accessory-options button, .decoration-choice button { min-height: 75px; font-size: .9rem; }
}
@media (max-width: 360px) {
  .game-title { font-size: 2.2rem; }
  .game-toolbar .control-label { font-size: .75rem; }
  .stage-window { height: 280px; }
  .stage-controls { gap: 10px; }
  .squish-button { padding-inline: 19px; }
  .squishy-customizer { padding-inline: 17px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  .game-shell { padding: 8px 12px; }
  .game-header { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
  .game-title { font-size: clamp(1.3rem, 3.4vw, 1.8rem); white-space: nowrap; }
  .game-toolbar { order: 0; gap: 7px; }
  .game-toolbar .toolbar-button { padding: 5px 10px; font-size: .85rem; }
  .squishy-workshop { grid-template-columns: minmax(0, 1fr) clamp(220px, 34vw, 290px); gap: 14px; }
  .squishy-stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; height: calc(100svh - 84px); border-radius: 24px; }
  .toy-heading { min-height: 66px; padding: 14px 174px 0 12px; text-align: left; }
  .toy-heading h2 { font-size: 1.2rem; }
  .toy-heading p { display: none; }
  .stage-window { position: static; height: auto; min-height: 0; }
  .view-controls { display: flex; right: 10px; top: 10px; gap: 4px; z-index: 2; }
  .stage-controls { padding: 0 12px 6px; gap: 14px; }
  #save-status { padding: 3px 12px 8px; font-size: .75rem; }
  .squish-button { min-height: 52px; font-size: 1.35rem; padding-inline: 26px; }
  .squishy-customizer { max-height: calc(100svh - 84px); overflow-y: auto; padding: 0 17px 17px; border-radius: 24px; }
  .customizer-heading { padding-top: 12px; }
}
