/* Original approved palette remains owned by site.css, experience.css and welcome.css. */
:root {
  --scroll-track: #fff9ef;
  scrollbar-color: var(--red) var(--scroll-track);
}
html[data-admin-theme=dark] { --scroll-track: #222124; }
* { scrollbar-color: var(--red) var(--scroll-track); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb {
  background: var(--red);
  border: 2px solid var(--scroll-track);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--red); }
::-webkit-scrollbar-corner { background: var(--scroll-track); }

/* Keep the original desktop poses; the runtime resumes them on touch devices.
   Native CSS remains the fallback when Web Animations is unavailable. */
.dimdom-floating { animation: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .universe-mascot > img { animation: welcome-dim 4.2s ease-in-out infinite; }
}
.no-mascot-motion :is(.mascot-motion, .mascot-motion img, .community-mascot img, .game-mascot) {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .mascot-motion, .mascot-motion img, .community-mascot img {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 760px) {
  .hero-character { bottom: 8px; }
}
@media (max-width: 560px) {
  .menu-focused .menu-mascot {
    display: block;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    margin: 0;
    padding: 4px;
  }
}
@media (forced-colors: active) {
  :root, * { scrollbar-color: auto; }
}

/* Original v10 artwork: preserve aspect ratios and let the browser rasterize
   the full-resolution image, without forced low-resolution 3D layers. */
.brand img, .footer-brand > img, .entry-logo, .loading-logo {
  object-fit: contain;
  image-rendering: auto;
  filter: none;
}
.brand img { height: auto; }
.mascot-motion img, .community-mascot img, .entry-characters img,
.loading-characters img, .game-mascot {
  backface-visibility: visible;
  image-rendering: auto;
}
.mascot-motion img, .community-mascot img { transform: none; }

/* A single footer layout owns these rules after the older page styles. */
#dimdom-app footer {
  padding: 32px clamp(20px, 5vw, 72px) calc(96px + env(safe-area-inset-bottom));
}
#dimdom-app .footer-top {
  grid-template-columns: minmax(220px, 1.1fr) minmax(240px, 1.2fr) minmax(160px, .8fr);
  align-items: start;
  gap: 24px 36px;
  padding: 0;
}
#dimdom-app .footer-identity {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.footer-brand { min-width: 0; }
.footer-brand > img { display: block; width: 140px; max-width: 100%; height: auto; }
#dimdom-app .footer-brand > p { margin: 10px 0 0; font-size: 14px; font-weight: 500; line-height: 1.4; }
#dimdom-app .footer-mascot {
  display: block;
  flex: 0 0 90px;
  width: 90px;
  height: 90px;
  margin: 0;
  padding: 0;
  grid-column: auto;
}
#dimdom-app .footer-mascot img { width: 100%; height: 100%; object-fit: contain; }
#dimdom-app .footer-contact { gap: 0; font-size: 16px; line-height: 1.4; }
#dimdom-app .footer-contact strong { margin-bottom: 8px; font-size: 13px; }
#dimdom-app .footer-contact a { display: flex; align-items: center; flex-wrap: wrap; min-height: 44px; padding: 6px 0; overflow-wrap: break-word; }
#dimdom-app .footer-contact [data-site-email] { display: block; line-height: 32px; overflow-wrap: anywhere; }
#dimdom-app .footer-links { grid-column: auto; display: flex; gap: 0 18px; align-items: start; }
#dimdom-app .footer-links a { min-height: 44px; font-size: 14px; }
#dimdom-app .footer-services {
  max-width: 1280px;
  margin: 20px auto 0;
  gap: 0 24px;
  padding: 14px 0 0;
  border-top: 1px solid;
  border-color: color-mix(in srgb, currentColor 25%, transparent);
}
#dimdom-app .footer-services a { display: flex; align-items: center; min-height: 44px; font-size: 14px; line-height: 1.4; }
#dimdom-app .install-app { max-width: 1280px; margin: 4px auto 12px; }
#dimdom-app .footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin: 0 auto;
  padding-top: 12px;
  font-size: 14px;
}
#dimdom-app .footer-legal { gap: 0 24px; }
#dimdom-app .dimop-footer-link { margin-left: auto; }
#dimdom-app .footer-bottom > span { flex-basis: 100%; font-size: 12px; line-height: 1.5; margin-top: 4px; opacity: .85; }
#dimdom-app footer :is(a, button, summary):focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
/* At the footer, the assistant shares the bottom control row. Legal links can
   scroll completely above it; the cart gets its own row when present. */
body.footer-in-view:not(.menu-focused) .assistant-launch { bottom: max(18px, calc(env(safe-area-inset-bottom) + 18px)); }
@media (min-width: 761px) {
  body.footer-in-view:has(.cart-button:not([hidden])) .assistant-launch { bottom: 88px; }
  body.footer-in-view:has(.cart-button:not([hidden])) #dimdom-app footer { padding-bottom: 154px; }
}
@media (max-width: 1000px) {
  #dimdom-app .footer-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #dimdom-app .footer-links { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  #dimdom-app .footer-top { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  #dimdom-app .footer-identity { max-width: 420px; width: 100%; }
  #dimdom-app .footer-brand > img { width: 150px; }
  #dimdom-app .footer-links { gap: 0 20px; }
  #dimdom-app .footer-services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  #dimdom-app .footer-legal { gap: 0 18px; }
  #dimdom-app .dimop-footer-link { margin-left: 0; }
  body.footer-in-view:not(.menu-focused) .assistant-launch { max-width: calc(100vw - 132px); right: 12px; font-size: 12px; gap: 6px; padding: 7px 10px; }
  body.footer-in-view:not(.menu-focused) .assistant-launch img { flex: 0 0 24px; width: 24px; height: 30px; }
  body.footer-in-view:not(.menu-focused):has(.cart-button:not([hidden])) .assistant-launch { bottom: max(94px, calc(env(safe-area-inset-bottom) + 94px)); }
  body:has(.cart-button:not([hidden])) #dimdom-app footer { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
}
