/* Sugar At interface — a shared, softer surface for the five Playground pages.
   Content, screen artwork, route order and editor behavior are unchanged. */
body.sa-playground {
  --ink: #17253b;
  --soft-ink: #626a73;
  --paper: #f8f7f4;
  --panel: #fff;
  --edge: #17253b24;
  --tile: #edede8;
  --tile-blue: #e5ebee;
  --tile-warm: #efece6;
  --field: #fff;
  --pg-radius: 16px;
  --pg-ease: cubic-bezier(.22, .68, 0, 1);
  --page-pad: clamp(18px, 3vw, 48px);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sugar-ui-font, 'Sugar Sans', Nimbus, 'Helvetica Neue', Arial, sans-serif);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
.sa-playground :is(.pg-hero-copy h1,.library-hero h1,.editor-heading h1) {
  font-family: inherit;
  font-weight: 400;
  font-size: clamp(48px, 6.3vw, 96px);
  line-height: 1.02;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.sa-playground :is(.pg-section-head h2,.play-creator h2,.pg-project-list h2,.pg-project-submit h2) {
  font-family: inherit;
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.1;
  font-size: clamp(30px, 3.4vw, 52px);
  text-wrap: balance;
}
.sa-playground :is(.pg-hero-copy>p:not(.pg-label),.library-hero p:not(.eyebrow),.editor-heading>p) {
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.55;
  color: var(--soft-ink);
}
.sa-playground :is(.pg-label,.eyebrow,.tile-copy small,.project-meta) {
  letter-spacing: .065em;
  font-weight: 700;
}
.sa-playground :is(.field input,.field textarea,.field select,.project-fields input,.project-fields textarea,.project-fields select) {
  font-family: inherit;
  color: var(--ink);
}
.sa-playground :is(pre,code,kbd,samp,.markdown-input) {
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}
.pg-header {
  min-height: 78px;
  border-bottom: 0;
  background: var(--paper);
}
.pg-header .pg-wordmark img { width: 120px; }
.pg-header nav { gap: clamp(18px, 2.3vw, 34px); }
.pg-header nav a,.pg-return { font-size: 13px; }
.pg-header nav a {
  position: relative;
  text-decoration: none;
  padding: 10px 0;
}
.pg-header nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--pg-ease);
}
.pg-header nav a:is(:hover,:focus-visible,.pg-active)::after { transform: scaleX(1); }
.pg-header nav a:hover { text-decoration: none; }
.pg-return {
  border: 1px solid var(--edge);
  padding: 8px 15px;
  border-radius: 999px;
  transition: background 200ms ease;
}
.pg-return:hover { text-decoration: none; background: #eeede8; }
.sa-play-nav {
  min-height: 60px;
  gap: 12px;
  border: 0;
  margin-bottom: 16px;
}
.sa-play-nav>div:first-child {
  gap: 4px;
  scrollbar-width: none;
  padding-block: 4px;
}
.sa-play-nav>div:first-child::-webkit-scrollbar { display: none; }
.sa-play-nav a {
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 400;
  transition: color 200ms ease, background 200ms ease;
}
.sa-play-nav a:hover { background: #eeede8; }
.sa-play-nav a[aria-current=page] { background: var(--ink); color: var(--paper); font-weight: 400; }
.sa-play-nav .sa-languages { padding: 3px; border: 1px solid var(--edge); border-radius: 999px; }
.sa-languages button { min-width: 34px; min-height: 30px; padding: 5px 8px; border-radius: 999px; font-size: 12px; }
.sa-languages [aria-pressed=true] { background: #e9eae5; text-decoration: none; }
.playground-main { padding-top: 0; }
.pg-hero { margin-inline: 0; border-radius: 18px; overflow: hidden; background: #eeeee7; }
.pg-hero-copy { padding: clamp(30px, 4vw, 64px); }
.pg-hero-print { background: #17253b; padding: clamp(20px, 2.5vw, 40px); }
.pg-hero-print img { transition: transform 600ms var(--pg-ease); }
.pg-feature {
  margin-top: 24px;
  min-height: 42px;
  padding: 8px 17px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  gap: 24px;
  transition: background 200ms ease, color 200ms ease;
}
.pg-feature:hover { color: var(--paper); background: var(--ink); }
.pg-section-head { margin-top: clamp(48px, 6vw, 88px); margin-bottom: 30px; gap: 18px; }
.play-toolbar { border: 0; padding: 12px 0; }
.play-filters { gap: 5px; }
.play-filters button {
  border-radius: 999px;
  border: 1px solid var(--edge);
  padding: 9px 16px;
  min-height: 40px;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.play-filters button:hover { background: #eeede8; }
.play-filters button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.play-search,.pill-select { border-radius: 999px; height: 44px; background: transparent; }
.play-search input { font-size: 14px; }
.gallery-meta { padding-block: 12px 24px; }
.play-grid { gap: 34px clamp(14px, 1.7vw, 26px); }
.play-card .tile-stage { border-radius: var(--pg-radius); background: #eeeee9; }
.play-card.category-business .tile-stage { background: #e7eced; }
.play-card.category-learning .tile-stage { background: #f0eae2; }
.play-card.category-games .tile-stage { background: #e4eae4; }
.play-card .tile-stage .play-device { transition: transform 500ms var(--pg-ease); }
.play-card .tile-copy { padding-top: 17px; }
.tile-copy h2 { font-size: clamp(20px, 1.65vw, 27px); line-height: 1.2; letter-spacing: -.025em; margin-bottom: 8px; }
.tile-copy small { font-size: 10px; margin-bottom: 7px; }
.tile-copy p { line-height: 1.5; }
.play-card .flash-button { margin-top: 8px; }
.button,.editor-bottom .button,.personal-actions .button,.personal-art .flash-button {
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 21px;
  font-size: 13px;
  font-weight: 400;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.button.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.button.primary:hover { background: #30435a; border-color: #30435a; }
.button.secondary { border-color: #17253b55; }
.button.secondary:hover { background: #e8ece8; }
.button.quiet { text-underline-offset: 5px; }
.button:disabled { cursor: not-allowed; }
.play-creator { padding-top: clamp(32px, 4vw, 60px); }
.library-hero,.pg-guide .editor-heading,.pg-projects .editor-heading { padding-block: clamp(32px, 4.5vw, 68px); }
.library-hero .hero-actions { flex-wrap: wrap; justify-content: flex-end; }
.personal-grid { gap: 28px; }
.personal-art,.editor-cover-art,.preview-panel .personal-art { border-radius: var(--pg-radius); }
.personal-body { padding: 18px 0; }
.personal-heading h2 { font-size: 24px; letter-spacing: -.03em; line-height: 1.15; }
.personal-actions { gap: 7px; }
.status,.demo-pill { border-radius: 999px; padding: 4px 9px; }
.more-button { border-radius: 50%; }
.more-menu { border-radius: 12px; box-shadow: 0 12px 32px #17253b14; }
.more-menu a,.more-menu button { border-radius: 8px; }
.editor-panel,.preview-panel,.next-panel { border-radius: var(--pg-radius); background: #fffdfa; border-color: var(--edge); }
.editor-panel h2,.preview-panel h2,.next-panel h2 { font-weight: 400; letter-spacing: -.025em; }
.editor-steps { border: 0; gap: 12px; }
.editor-steps span,.editor-steps .active span { border-radius: 50%; }
.editor-steps .active span { background: var(--ink); color: #fff; }
.field input,.field textarea,.field select,.project-fields input,.project-fields textarea,.project-fields select {
  border-radius: 10px;
  min-height: 46px;
  border-color: var(--edge);
  padding: 12px 14px;
  font-size: 16px;
  transition: border-color 180ms ease, background 180ms ease;
}
.field :is(input,textarea,select):focus,.project-fields :is(input,textarea,select):focus { border-color: #17253b88; background: #fff; }
.project-fields .consent input { min-height: 0; padding: 0; }
.markdown-tools { border-radius: 10px 10px 0 0; border-color: var(--edge); }
.field textarea.markdown-input { border-radius: 0 0 10px 10px; font-size: 14px; line-height: 1.6; }
.editor-file { border-radius: 12px; border-color: #17253b40; background: #f8f7f4; }
.editor-bottom { border-radius: var(--pg-radius); background: #f8f7f4f2; box-shadow: 0 4px 28px #17253b0b; }
.pg-project-submit { padding-top: 42px; }
.project-tabs { gap: 8px; padding-block: 12px; border-top: 0; }
.project-tabs a { padding: 10px 17px; border: 1px solid var(--edge); border-radius: 999px; text-decoration: none; }
.project-tabs a:hover { background: #eeede8; }
.public-project { padding-block: 28px; }
.public-project h3 { letter-spacing: -.03em; }
.guide-data { padding-block: 30px; }
.guide-data h2 { letter-spacing: -.03em; }
.guide-data :is(dd,li,p),.public-project p,.pg-project-submit>div>p { line-height: 1.65; }
.play-dialog { border-radius: 18px; border: 0; box-shadow: 0 24px 90px #17253b26; }
.play-dialog::backdrop { background: #17253b66; backdrop-filter: blur(5px); }
.play-dialog[open] { animation: pg-dialog-enter 260ms var(--pg-ease); }
.dialog-close { width: 40px; height: 40px; border-radius: 50%; background: #f8f7f4ed; }
.dialog-content h2 { font-family: inherit; font-size: clamp(30px, 3.2vw, 46px); letter-spacing: -.04em; line-height: 1.08; }
.pg-runtime { border-radius: 12px; background: #f0f1ec; border-color: transparent; }
.play-toast { border-radius: 999px; padding: 12px 22px; }
.completion-icon { border-radius: 50%; }
.pg-footer { padding-block: 38px 44px; border-top-color: var(--edge); }
.pg-footer nav a { color: var(--soft-ink); }
.sa-playground :is(button,a,input,select,textarea):focus-visible { outline: 2px solid #496887; outline-offset: 4px; }
@keyframes pg-dialog-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (hover:hover) { .pg-hero-print:hover img { transform: scale(1.025); } }
@media(max-width:950px) {
  .pg-header nav { gap: 16px; }
  .pg-header nav a,.pg-return { font-size: 12px; }
  .pg-header .pg-wordmark img { width: 104px; }
  .library-hero .hero-actions { max-width: 48%; }
  .sa-play-nav a { padding-inline: 12px; }
}
@media(max-width:650px) {
  .pg-header { min-height: 68px; gap: 12px; }
  .pg-header .pg-wordmark img { width: 108px; }
  .pg-return { padding: 7px 12px; }
  .sa-play-nav { min-height: 56px; padding-inline: 14px; margin-bottom: 12px; }
  .sa-play-nav>div:first-child { gap: 3px; }
  .sa-play-nav a { font-size: 12px; padding: 9px 12px; }
  .sa-languages button { min-width: 29px; padding: 5px; font-size: 11px; }
  .pg-hero { border-radius: 14px; }
  .pg-hero-copy { padding: 30px 24px; }
  .sa-playground :is(.pg-hero-copy h1,.library-hero h1,.editor-heading h1) { font-size: clamp(40px, 10vw, 60px); letter-spacing: -.045em; }
  .sa-playground .editor-heading h1 { font-size: clamp(36px, 9vw, 52px); }
  .pg-hero-copy>p:not(.pg-label) { font-size: 16px; }
  .pg-feature { margin-top: 20px; }
  .pg-hero-print { padding: 20px; }
  .pg-section-head { margin-top: 42px; align-items: end; }
  .pg-section-head a { font-size: 12px; text-align: right; max-width: 110px; }
  .play-grid { gap: 26px 12px; }
  .play-filters button { font-size: 12px; padding: 9px 13px; }
  .play-card .tile-stage { border-radius: 12px; }
  .tile-copy h2 { font-size: 20px; }
  .tile-copy p { font-size: 13px; line-height: 1.45; }
  .play-card .tile-copy { padding-top: 13px; }
  .library-hero .hero-actions { max-width: none; justify-content: flex-start; }
  .hero-actions .button { min-height: 42px; padding-inline: 15px; }
  .library-controls { grid-template-columns: minmax(0,1fr) 120px; }
  .pill-select { font-size: 12px; padding-inline: 12px; }
  .personal-grid { gap: 24px; }
  .editor-panel,.preview-panel,.next-panel { border-radius: 14px; }
  .editor-bottom { padding: 12px; bottom: 9px; border-radius: 14px; }
  .editor-bottom .button { min-height: 40px; padding: 9px 12px; font-size: 12px; }
  .editor-bottom .save-status { font-size: 12px; }
  .editor-steps { gap: 8px; }
  .dialog-actions .button { font-size: 12px; min-height: 42px; }
  .detail-dialog .dialog-content { padding: 28px 24px; }
  .pg-footer { gap: 20px; }
  .pg-footer nav { gap: 8px 20px; }
}
@media(prefers-reduced-motion:reduce) {
  .sa-playground *,.sa-playground *::before,.sa-playground *::after { animation: none!important; transition: none!important; scroll-behavior: auto!important; }
}
