/* Original character/shop layouts, scoped to imported controls. */
.emoji-hud-icon.character-hud-icon {
  top: -1px;
}

.emoji-hud-icon.character-hud-icon img {
  width: 60px;
  height: 48px;
}

.emoji-hud-button.character-hud-button strong {
  font-size: 14px;
}

.collection-menu-button.character-hud-button {
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.54), transparent 25%),
    linear-gradient(135deg, #bcff37 0%, #39ff57 38%, #ff54ce 72%, #ff1ba8 100%);
}

.emoji-hud-button.character-hud-button::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.24) 0 7px, rgba(178, 55, 76, 0.14) 7px 14px);
}

.character-hud-button.has-alert .character-hud-alert {
  display: block;
}

#characterOverlay {
  z-index: 82;
}

.character-modal {
  position: relative;
  display: grid;
  width: min(390px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 48px));
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 4px;
  padding: 15px;
  border: 5px solid #180c21;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.72), transparent 33%),
    linear-gradient(160deg, #a0f6de 0%, #a5e5f1 48%, #a8c7ff 100%);
  box-shadow:
    inset 0 6px 0 rgba(255, 255, 255, 0.42),
    inset 0 -7px 0 rgba(62, 31, 118, 0.18),
    0 10px 0 rgba(0, 0, 0, 0.34),
    0 24px 48px rgba(19, 8, 37, 0.34);
  overflow: visible;
}

.character-modal::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(24, 12, 33, 0.24);
  border-radius: 17px;
  pointer-events: none;
}

.character-close {
  position: absolute;
  top: -20px;
  right: -20px;
  z-index: 6;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  padding: 5px 0 0;
  border: 4px solid #180913;
  border-radius: 12px;
  background: linear-gradient(145deg, #6e9bff, #215ad4);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.34), 0 5px 0 rgba(0, 0, 0, 0.32);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-heavy);
  font-size: 34px;
  line-height: 1;
  text-shadow: var(--outline-2);
}

.character-title-box {
  position: absolute;
  top: -34px;
  left: 50%;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 2px 9px 4px 16px;
  border: 4px solid #110810;
  border-radius: 12px;
  background: linear-gradient(180deg, #b9eeff 0%, #61cff7 100%);
  box-shadow:
    inset 0 5px 0 rgba(255, 255, 255, 0.42),
    0 5px 0 rgba(0, 0, 0, 0.28);
  color: #fff;
  font-family: var(--font-heavy);
  font-size: 32px;
  line-height: 0.95;
  text-shadow: var(--outline-3);
  transform: translateX(-50%);
  white-space: nowrap;
}

.character-title-icon {
  display: grid;
  width: 30px;
  height: 46px;
  flex: 0 0 30px;
  place-items: center;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.34));
  transform: translate(-13px, -2px);
}

.character-title-icon img {
  display: block;
  width: 47px;
  height: 47px;
  object-fit: contain;
}

.character-preview-shell {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.36), transparent 57%),
    #bdeeff;
}

.character-preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.character-part-controls {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.character-part-controls.hidden {
  display: none;
}

.character-arrow {
  --arrow-row: 18%;
  position: absolute;
  top: var(--arrow-row);
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  padding: 0;
  border: 4px solid #06142f;
  border-radius: 16px;
  background: linear-gradient(145deg, #28789d 0%, #10445d 100%);
  box-shadow:
    inset 0 5px 0 rgba(121, 190, 255, 0.36),
    0 6px 0 rgba(6, 20, 47, 0.38);
  cursor: pointer;
  pointer-events: auto;
  transform: translateY(-50%);
}

.character-arrow:hover {
  filter: brightness(1.08);
}

.character-arrow:active {
  margin-top: 3px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.62), 0 3px 0 rgba(7, 29, 77, 0.32);
}

.character-arrow.is-left {
  left: 28px;
}

.character-arrow.is-right {
  right: 28px;
}

.character-arrow span {
  width: 46px;
  height: 46px;
  background: url("../assets/icons/character-arrow-light-lossless.webp?v=20260724") center / contain no-repeat;
}

.character-arrow.is-left span {
  transform: rotate(180deg);
}

.character-arrow.is-right span {
  transform: none;
}

.character-arrow.row-face {
  --arrow-row: 26%;
}

.character-arrow.row-hair {
  --arrow-row: 9%;
}

.character-arrow.row-shirt {
  --arrow-row: 46%;
}

.character-arrow.row-pants {
  --arrow-row: 69%;
}

.character-arrow.row-shoes {
  --arrow-row: 89%;
}

.character-palette-panel {
  position: relative;
  z-index: 3;
  display: grid;
  min-height: 86px;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 14px 15px;
  border: 4px solid #180c21;
  border-radius: 18px;
  background: rgba(255, 250, 244, 0.93);
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.75),
    0 6px 0 rgba(0, 0, 0, 0.27);
}

.character-palette-swatch {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  max-width: 66px;
  justify-self: center;
  border: 4px solid #24142f;
  border-radius: 15px;
  box-shadow:
    inset 0 5px 0 rgba(255, 255, 255, 0.3),
    0 4px 0 rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.character-palette-panel.has-palette-purchases {
  gap: 8px;
  padding: 6px 10px 7px;
}

.character-palette-option {
  display: grid;
  min-width: 0;
  grid-template-rows: 66px 26px;
  gap: 4px;
  place-items: center;
}

.has-palette-purchases .character-palette-swatch {
  width: 66px;
  max-width: 66px;
}

.character-palette-buy,
.character-palette-buy-spacer {
  width: 66px;
  height: 26px;
}

.character-palette-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 0 3px;
  border: 2px solid #24142f;
  border-radius: 7px;
  background: linear-gradient(#4fffde, #28f4c7);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 2px 0 rgba(36, 20, 47, 0.45);
  color: #fff;
  font: 900 16px/1 GameHeavy, Arial, sans-serif;
  text-shadow:
    -1px -1px 0 #005d45,
    1px -1px 0 #005d45,
    -1px 1px 0 #005d45,
    1px 1px 0 #005d45;
  cursor: pointer;
}

.character-palette-buy img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  object-fit: contain;
}

.character-palette-buy .trophy-inline-icon {
  filter:
    drop-shadow(0 -0.65px 0 #080402)
    drop-shadow(0.65px 0 0 #080402)
    drop-shadow(0 0.65px 0 #080402)
    drop-shadow(-0.65px 0 0 #080402)
    drop-shadow(0 1.2px 0 rgba(0, 0, 0, 0.3));
}

.character-palette-buy span {
  paint-order: stroke fill;
  -webkit-text-stroke: 1.7px #005d45;
  transform: translateX(1px);
}

.character-palette-buy:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.character-palette-buy:active:not(:disabled) {
  transform: translateY(1px);
}

.character-palette-buy:disabled {
  filter: grayscale(0.25);
  opacity: 0.78;
  cursor: default;
}

.character-palette-lock {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 1px 0 rgba(22, 10, 35, 0.65));
  transform-origin: 50% 85%;
  animation: character-lock-bob 1.9s ease-in-out infinite;
  pointer-events: none;
}

.character-palette-option.is-locked .character-palette-swatch {
  cursor: pointer;
}

.character-palette-swatch:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.character-palette-swatch:active {
  transform: translateY(1px) scale(0.96);
}

.character-palette-swatch.is-selected {
  outline: 3px solid #9be6ff;
  outline-offset: 2px;
  box-shadow:
    inset 0 5px 0 rgba(255, 255, 255, 0.35),
    0 4px 0 rgba(0, 0, 0, 0.28);
}

@media (max-width: 520px), (max-height: 700px) {
  :where(html.has-touch-controls) .character-modal {
    width: min(350px, calc(100vw - 18px));
    height: min(560px, calc(100vh - 44px));
    gap: 4px;
    padding: 11px;
  }

  :where(html.has-touch-controls) .character-title-box {
    top: -30px;
    padding: 1px 7px 3px 12px;
    font-size: 27px;
  }

  :where(html.has-touch-controls) .character-title-icon {
    width: 28px;
    height: 40px;
    flex-basis: 28px;
  }

  :where(html.has-touch-controls) .character-title-icon img {
    width: 42px;
    height: 42px;
  }

  :where(html.has-touch-controls) .character-close {
    top: -15px;
    right: -15px;
    width: 42px;
    height: 42px;
    border-width: 3px;
    border-radius: 10px;
    font-size: 28px;
  }

  :where(html.has-touch-controls) .character-palette-panel {
    min-height: 70px;
    gap: 8px;
    padding: 8px 10px 11px;
  }

  :where(html.has-touch-controls) .character-palette-panel.has-palette-purchases {
    padding: 4px 8px 6px;
  }

  :where(html.has-touch-controls) .character-palette-option {
    grid-template-rows: 54px 22px;
    gap: 4px;
  }

  :where(html.has-touch-controls) .character-palette-swatch {
    max-width: 54px;
    border-radius: 12px;
  }

  .has-palette-purchases .character-palette-swatch {
    width: 54px;
    max-width: 54px;
  }

  :where(html.has-touch-controls) .character-palette-buy,
  :where(html.has-touch-controls) .character-palette-buy-spacer {
    width: 54px;
    height: 22px;
  }

  :where(html.has-touch-controls) .character-palette-buy {
    font-size: 14px;
  }

  :where(html.has-touch-controls) .character-palette-buy img {
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 520px) {
  :where(html.has-touch-controls) .character-arrow {
    width: 49px;
    height: 49px;
    border-radius: 13px;
  }

  :where(html.has-touch-controls) .character-arrow.is-left {
    left: 22px;
  }

  :where(html.has-touch-controls) .character-arrow.is-right {
    right: 22px;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  :where(html.has-touch-controls) .character-modal {
    width: min(330px, calc(100vw - 18px));
    height: calc(100vh - 56px);
  }

  :where(html.has-touch-controls) .character-palette-panel {
    min-height: 58px;
  }

  :where(html.has-touch-controls) .character-palette-panel.has-palette-purchases {
    padding: 3px 7px;
  }

  :where(html.has-touch-controls) .character-palette-option {
    grid-template-rows: 44px 18px;
    gap: 3px;
  }

  :where(html.has-touch-controls) .character-palette-swatch {
    max-width: 44px;
  }

  .has-palette-purchases .character-palette-swatch {
    width: 44px;
    max-width: 44px;
  }

  :where(html.has-touch-controls) .character-palette-buy,
  :where(html.has-touch-controls) .character-palette-buy-spacer {
    width: 44px;
    height: 18px;
  }

  :where(html.has-touch-controls) .character-palette-buy {
    border-width: 1px;
    border-radius: 5px;
    font-size: 12px;
  }

  :where(html.has-touch-controls) .character-palette-buy img {
    width: 12px;
    height: 12px;
  }

  :where(html.has-touch-controls) .character-palette-lock {
    right: -4px;
    bottom: -3px;
    width: 22px;
    height: 22px;
  }
}

.icon-button.skin {
  z-index: 2;
  overflow: visible !important;
  clip-path: none;
  contain: none;
  --button-stripe-color: rgba(167, 78, 218, 0.12);
  --button-glow-color: rgba(224, 166, 255, 0.58);
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.76) 0 8%, rgba(255, 255, 255, 0.24) 18%, transparent 31%),
    linear-gradient(145deg, #f9e5ff 0%, #e5b1ff 50%, #bc8aff 100%);
}

.icon-button.skin .skin-icon-slot {
  position: absolute;
  top: -4px;
  left: 50%;
  z-index: 1;
  width: 96px;
  height: 74px;
  justify-items: center;
  overflow: visible !important;
  clip-path: none;
  contain: none;
  transform: translateX(-50%);
}

.skin-icon-image {
  width: 62px;
  height: 62px;
  object-fit: contain;
  overflow: visible !important;
  clip-path: none;
  transform: translateY(-5px);
  transform-origin: center;
  filter: none;
}

.icon-button.skin strong {
  position: absolute;
  right: 6px;
  bottom: 4px;
  left: 6px;
  z-index: 2;
  font-size: 16px;
}

#mathQuizOverlay {
  z-index: 86;
}

.math-quiz-close {
  display: grid;
  place-items: center;
  padding: 5px 0 0;
}

.skin-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1040px, calc(100vw - 28px));
  height: auto;
  max-height: calc(100vh - 28px);
  overflow: hidden;
  padding: clamp(12px, 2.1vw, 20px) clamp(16px, 3vw, 28px) clamp(16px, 3vw, 28px);
  border: 5px solid #180913;
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.38), transparent 18%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 6px, transparent 6px 24px),
    linear-gradient(140deg, #ff9fd0 0%, #f5bddc 38%, #b5edb7 66%, #69db93 100%);
  box-shadow:
    inset 0 6px 0 rgba(255, 255, 255, 0.3),
    0 12px 0 rgba(0, 0, 0, 0.34),
    0 18px 34px rgba(0, 0, 0, 0.28);
}

.math-quiz-modal {
  position: relative;
  width: min(620px, calc(100vw - 28px));
  padding: 24px 26px 28px;
  border: 5px solid #170812;
  border-radius: 24px;
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 255, 255, 0.55), transparent 16%),
    repeating-linear-gradient(-24deg, rgba(255, 255, 255, 0.14) 0 10px, transparent 10px 24px),
    linear-gradient(150deg, #72a5ff 0%, #73ffe7 48%, #7fe2ff 100%);
  text-align: center;
  box-shadow:
    inset 0 6px 0 rgba(255, 255, 255, 0.36),
    0 12px 0 rgba(0, 0, 0, 0.36),
    0 18px 34px rgba(0, 0, 0, 0.26);
}

.is-hearts-quiz .math-quiz-modal {
  width: min(520px, calc(100vw - 28px));
  padding: 14px 20px 18px;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.48), transparent 15%),
    repeating-linear-gradient(-24deg, rgba(255, 255, 255, 0.13) 0 10px, transparent 10px 24px),
    linear-gradient(150deg, #80a6ff 0%, #a8ffe4 46%, #cefff0 100%);
}

.is-hearts-quiz .math-quiz-modal h2 {
  margin-top: 24px;
  margin-bottom: 6px;
  font-size: clamp(34px, 5.4vw, 46px);
}

.math-quiz-modal::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 3px solid rgba(23, 8, 18, 0.72);
  border-radius: 17px;
  pointer-events: none;
}

.math-quiz-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 1;
  width: 50px;
  height: 50px;
  border: 4px solid #170812;
  border-radius: 12px;
  background: linear-gradient(145deg, #6e9bff, #215ad4);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-heavy);
  font-size: 31px;
  line-height: 1;
  text-shadow: var(--outline-2);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.34), 0 5px 0 rgba(0, 0, 0, 0.32);
}

.is-hearts-quiz .math-quiz-close {
  display: none;
}

.math-quiz-kicker,
.math-quiz-progress,
.math-quiz-question,
.math-quiz-feedback,
.math-quiz-form button,
.math-quiz-keypad button {
  position: relative;
  z-index: 1;
  font-family: var(--font-heavy);
  text-shadow: var(--outline-2);
}

.math-quiz-kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-top: -8px;
  margin-bottom: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  text-shadow:
    -1px -1px 0 #07162f,
    0 -1px 0 #07162f,
    1px -1px 0 #07162f,
    -1px 0 0 #07162f,
    1px 0 0 #07162f,
    -1px 1px 0 #07162f,
    0 1px 0 #07162f,
    1px 1px 0 #07162f,
    0 2px 0 rgba(7, 22, 47, 0.62);
}

.is-hearts-quiz .math-quiz-kicker {
  margin-top: 3px;
  margin-bottom: 8px;
}

.is-hearts-quiz .math-quiz-progress {
  font-size: 20px;
}

.is-hearts-quiz .math-quiz-question {
  margin: 10px auto 12px;
  padding: 12px 16px 10px;
  font-size: clamp(38px, 7.8vw, 66px);
}

.is-hearts-quiz .math-quiz-answer-field,
.is-hearts-quiz .math-quiz-answer-field input {
  height: 54px;
}

.is-hearts-quiz .math-quiz-form button {
  min-width: 126px;
  font-size: 25px;
}

.is-hearts-quiz .math-quiz-feedback {
  min-height: 24px;
  margin-top: 6px;
}

.math-quiz-modal h2 {
  position: relative;
  z-index: 1;
  margin: 0 44px 10px;
  color: #fff;
  font-size: clamp(38px, 6vw, 52px);
  line-height: 0.95;
  text-shadow: var(--outline-3);
}

.math-quiz-progress {
  color: #fff;
  font-size: 22px;
}

.math-quiz-question {
  margin: 14px auto;
  width: min(430px, 100%);
  padding: 16px 18px 14px;
  border: 4px solid #170812;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #c9f3ff);
  color: #fff;
  font-size: clamp(42px, 9vw, 76px);
  line-height: 1;
  -webkit-text-stroke: 0;
  paint-order: stroke fill;
  text-shadow: var(--outline-2);
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.55), 0 6px 0 rgba(0, 0, 0, 0.24);
}

.math-quiz-question-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.math-quiz-mark {
  display: inline-block;
  transform: translateY(0.03em);
  font-family: var(--font-heavy);
  font-size: 0.95em;
  font-weight: 900;
}

.math-quiz-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  width: min(430px, 100%);
  margin: 0 auto;
}

.math-quiz-answer-field {
  position: relative;
  min-width: 0;
  height: 62px;
  overflow: visible;
}

.math-quiz-answer-field::after {
  content: attr(data-value);
  position: absolute;
  inset: -10px 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #fff;
  font: 900 36px/1 var(--font-heavy);
  text-align: center;
  text-shadow:
    -2px -2px 0 #170812,
    0 -2px 0 #170812,
    2px -2px 0 #170812,
    -2px 0 0 #170812,
    2px 0 0 #170812,
    -2px 2px 0 #170812,
    0 2px 0 #170812,
    2px 2px 0 #170812,
    0 4px 0 #170812;
  pointer-events: none;
}

.math-quiz-answer-field.is-wrong::after {
  color: #4f81ff;
}

.math-quiz-answer-field input {
  box-sizing: border-box;
  appearance: textfield;
  -moz-appearance: textfield;
  position: relative;
  z-index: 1;
  min-width: 0;
  width: 100%;
  height: 62px;
  padding: 0 12px;
  border: 4px solid #170812;
  border-radius: 14px;
  background: #fff;
  color: transparent;
  caret-color: #170812;
  font: 900 32px var(--font-heavy);
  text-align: center;
  text-shadow: none;
  outline: none;
  box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.08);
}

.math-quiz-answer-field input::-webkit-outer-spin-button,
.math-quiz-answer-field input::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.is-samsung-galaxy-tablet .math-quiz-answer-field input:disabled {
  opacity: 1;
  pointer-events: none;
  -webkit-text-fill-color: transparent;
}

.math-quiz-form button {
  min-width: 136px;
  border: 4px solid #170812;
  border-radius: 14px;
  background: linear-gradient(180deg, #74fffe, #29bac8);
  color: #fff;
  cursor: pointer;
  font-size: 28px;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.36), 0 5px 0 rgba(0, 0, 0, 0.28);
}

.math-quiz-keypad {
  position: relative;
  z-index: 1;
  display: none;
  width: min(430px, 100%);
  margin: 10px auto 0;
  gap: 8px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.has-touch-controls .math-quiz-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.math-quiz-keypad button {
  min-height: 44px;
  border: 3px solid #170812;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #b9efff);
  color: #fff;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.48), 0 4px 0 rgba(0, 0, 0, 0.26);
}

.math-quiz-feedback {
  min-height: 34px;
  margin-top: 10px;
  color: #fff;
  font-size: 22px;
}

.math-quiz-feedback.bad {
  color: #4a7dff;
}

.math-quiz-feedback.good {
  color: #fff;
}

.math-quiz-dots {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.math-quiz-dots span {
  width: 18px;
  height: 18px;
  border: 3px solid #170812;
  border-radius: 50%;
  background: #fff;
}

.math-quiz-dots span.done {
  background: #56f5ff;
}

:where(html.has-touch-controls) .math-quiz-modal,
  :where(html.has-touch-controls) .math-quiz-modal * {
    font-family: var(--font-heavy);
    letter-spacing: 0;
  }

:where(html.has-touch-controls) .math-quiz-answer-field input {
    caret-color: transparent;
  }

:where(html.has-touch-controls) .math-quiz-keypad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(300px, 100%);
  }

@media (orientation: portrait) {
  :where(html.has-touch-controls) .math-quiz-modal {
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 22px);
    padding: 16px 16px 18px;
    overflow: hidden;
  }

  :where(html.has-touch-controls) .math-quiz-modal::before {
    inset: 8px;
    border-radius: 14px;
  }

  :where(html.has-touch-controls) .math-quiz-close {
    top: 8px;
    right: 10px;
    width: 42px;
    height: 42px;
    font-size: 25px;
  }

  :where(html.has-touch-controls) .math-quiz-kicker {
    margin-top: -4px;
    margin-bottom: 12px;
  }

  :where(html.has-touch-controls) .math-quiz-modal h2 {
    margin: 0 42px 7px;
    font-size: clamp(30px, 9vw, 42px);
  }

  :where(html.has-touch-controls) .math-quiz-progress {
    font-size: 18px;
  }

  :where(html.has-touch-controls) .math-quiz-question {
    width: min(310px, 100%);
    margin: 10px auto;
    padding: 12px 14px 10px;
    font-size: clamp(38px, 12vw, 58px);
  }

  :where(html.has-touch-controls) .math-quiz-form {
    width: min(300px, 100%);
    grid-template-columns: minmax(0, 1fr) minmax(98px, 0.58fr);
    gap: 8px;
  }

  :where(html.has-touch-controls) .math-quiz-answer-field,
  :where(html.has-touch-controls) .math-quiz-answer-field input {
    height: 48px;
  }

  :where(html.has-touch-controls) .math-quiz-answer-field::after {
    inset: -7px 10px;
    font-size: 30px;
  }

  :where(html.has-touch-controls) .math-quiz-form button {
    min-width: 0;
    border-width: 3px;
    border-radius: 11px;
    font-size: clamp(18px, 5.4vw, 21px);
  }

  :where(html.has-touch-controls) .math-quiz-keypad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(300px, 100%);
    gap: 6px;
    margin-top: 8px;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button {
    min-height: 40px;
    border-width: 3px;
    border-radius: 10px;
    font-size: 22px;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="1"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="4"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="7"] {
    grid-column: 1;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="2"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="5"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="8"] {
    grid-column: 2;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="3"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="6"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="9"] {
    grid-column: 3;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="0"] {
    grid-column: 1 / span 2;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="back"] {
    grid-column: 3;
    background: linear-gradient(180deg, #d4e1ff, #6f9cff);
    color: #fff;
    box-shadow:
      inset 0 3px 0 rgba(255, 255, 255, 0.5),
      0 4px 0 rgba(87, 8, 30, 0.38),
      0 0 10px rgba(255, 86, 135, 0.28);
  }

  :where(html.has-touch-controls) .math-quiz-feedback {
    min-height: 20px;
    margin-top: 5px;
    font-size: 16px;
  }

  :where(html.has-touch-controls) .math-quiz-dots {
    margin-top: 3px;
    gap: 6px;
  }

  :where(html.has-touch-controls) .math-quiz-dots span {
    width: 12px;
    height: 12px;
    border-width: 2px;
  }
}
@media (orientation: landscape) {

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-modal h2,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-modal h2 {
    font-size: clamp(18px, 2.7vw, 22px) !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-form button,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-form button {
    font-size: 12px !important;
    text-shadow: var(--outline-1) !important;
  }
}

@media (orientation: portrait) {
  html.has-touch-controls .skin-card[data-skin-card="bunny_runner"] .skin-preview-image {
    height: 72px !important;
    bottom: 0 !important;
  }
}
@media (orientation: landscape) {

  html.has-touch-controls:not(.is-tablet-device) #mathQuizOverlay {
    padding: 4px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-modal,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-modal {
    box-sizing: border-box !important;
    width: min(520px, calc(100vw - 128px)) !important;
    max-height: calc(100dvh - 8px) !important;
    padding: 6px 12px 7px !important;
    overflow: hidden !important;
    border-width: 3px !important;
    border-radius: 13px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-modal::before {
    inset: 4px !important;
    border-width: 2px !important;
    border-radius: 9px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-close {
    top: 5px !important;
    right: 6px !important;
    width: 30px !important;
    height: 30px !important;
    padding-top: 2px !important;
    border-width: 2px !important;
    border-radius: 7px !important;
    font-size: 19px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-kicker,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-kicker {
    margin: -2px 0 1px !important;
    font-size: 11px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-modal h2,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-modal h2 {
    margin: 0 34px 0 !important;
    font-size: clamp(21px, 3.4vw, 28px) !important;
    line-height: 0.92 !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-progress,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-progress {
    font-size: 12px !important;
    line-height: 1 !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-question,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-question {
    box-sizing: border-box !important;
    width: min(330px, 100%) !important;
    margin: 3px auto 4px !important;
    padding: 5px 8px 4px !important;
    border-width: 3px !important;
    border-radius: 9px !important;
    font-size: clamp(29px, 4.8vw, 42px) !important;
    line-height: 1 !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-form {
    width: min(330px, 100%) !important;
    grid-template-columns: minmax(0, 1fr) 78px !important;
    gap: 5px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-answer-field,
  html.has-touch-controls:not(.is-tablet-device) .math-quiz-answer-field input,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-answer-field,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-answer-field input {
    height: 32px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-answer-field input {
    border-width: 2px !important;
    border-radius: 8px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-answer-field::after {
    inset: -4px 6px !important;
    font-size: 20px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-form button,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-form button {
    min-width: 0 !important;
    border-width: 2px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-keypad {
    width: min(300px, 100%) !important;
    gap: 4px !important;
    margin-top: 5px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-keypad button {
    min-height: 28px !important;
    padding: 1px 4px !important;
    border-width: 2px !important;
    border-radius: 7px !important;
    font-size: 16px !important;
    line-height: 1 !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-feedback {
    min-height: 11px !important;
    margin-top: 2px !important;
    font-size: 11px !important;
    line-height: 1 !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-dots {
    gap: 4px !important;
    margin-top: 1px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-dots span {
    width: 8px !important;
    height: 8px !important;
    border-width: 1px !important;
  }
}

@media (orientation: landscape) {
  :where(html.has-touch-controls) .math-quiz-modal {
    width: min(620px, calc(100vw - 144px));
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 12px);
    padding: 10px 18px 12px;
    border-width: 3px;
    border-radius: 14px;
    overflow: hidden;
  }

  :where(html.has-touch-controls) .is-hearts-quiz .math-quiz-modal {
    width: min(640px, calc(100vw - 144px));
    padding: 10px 18px 12px;
  }

  :where(html.has-touch-controls) .math-quiz-modal::before {
    inset: 5px;
    border-width: 2px;
    border-radius: 10px;
  }

  :where(html.has-touch-controls) .math-quiz-close {
    top: 6px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-width: 3px;
    border-radius: 8px;
    font-size: 21px;
  }

  :where(html.has-touch-controls) .math-quiz-kicker {
    margin-top: -2px;
    margin-bottom: 3px;
    font-size: 12px;
  }

  :where(html.has-touch-controls) .math-quiz-modal h2,
  :where(html.has-touch-controls) .is-hearts-quiz .math-quiz-modal h2 {
    margin: 0 36px 2px;
    font-size: clamp(22px, 4.1vw, 31px);
  }

  :where(html.has-touch-controls) .math-quiz-progress,
  :where(html.has-touch-controls) .is-hearts-quiz .math-quiz-progress {
    font-size: 13px;
  }

  :where(html.has-touch-controls) .math-quiz-question,
  :where(html.has-touch-controls) .is-hearts-quiz .math-quiz-question {
    width: min(410px, 100%);
    margin: 4px auto 5px;
    padding: 9px 10px 7px;
    border-width: 3px;
    border-radius: 10px;
    font-size: clamp(34px, 5.8vw, 54px);
    -webkit-text-stroke-width: 0;
    text-shadow: var(--outline-2);
  }

  :where(html.has-touch-controls) .math-quiz-form {
    width: min(410px, 100%);
    grid-template-columns: 1fr auto;
    gap: 6px;
  }

  :where(html.has-touch-controls) .math-quiz-answer-field,
  :where(html.has-touch-controls) .math-quiz-answer-field input,
  :where(html.has-touch-controls) .is-hearts-quiz .math-quiz-answer-field,
  :where(html.has-touch-controls) .is-hearts-quiz .math-quiz-answer-field input {
    height: 36px;
  }

  :where(html.has-touch-controls) .math-quiz-answer-field input {
    border-width: 3px;
    border-radius: 9px;
  }

  :where(html.has-touch-controls) .math-quiz-answer-field::after {
    inset: -5px 8px;
    font-size: 23px;
    text-shadow: var(--outline-1);
  }

  :where(html.has-touch-controls) .math-quiz-form button,
  :where(html.has-touch-controls) .is-hearts-quiz .math-quiz-form button {
    min-width: 88px;
    border-width: 3px;
    border-radius: 9px;
    font-size: 17px;
  }

  :where(html.has-touch-controls) .math-quiz-keypad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(360px, 100%);
    gap: 7px;
    margin-top: 8px;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button {
    min-height: 36px;
    border-width: 2px;
    border-radius: 7px;
    font-size: 18px;
    text-shadow: var(--outline-1);
  }

  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="1"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="4"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="7"] {
    grid-column: 1;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="2"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="5"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="8"] {
    grid-column: 2;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="3"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="6"],
  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="9"] {
    grid-column: 3;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="0"] {
    grid-column: 1 / span 2;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button[data-quiz-key="back"] {
    grid-column: 3;
    background: linear-gradient(180deg, #d4e1ff, #6f9cff);
    color: #fff;
    box-shadow:
      inset 0 3px 0 rgba(255, 255, 255, 0.5),
      0 4px 0 rgba(87, 8, 30, 0.38),
      0 0 10px rgba(255, 86, 135, 0.28);
  }

  :where(html.has-touch-controls) .math-quiz-feedback,
  :where(html.has-touch-controls) .is-hearts-quiz .math-quiz-feedback {
    min-height: 15px;
    margin-top: 2px;
    font-size: 12px;
  }

  :where(html.has-touch-controls) .math-quiz-dots {
    margin-top: 2px;
    gap: 5px;
  }

  :where(html.has-touch-controls) .math-quiz-dots span {
    width: 8px;
    height: 8px;
    border-width: 2px;
  }
}

.skin-modal::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 3px solid rgba(24, 9, 19, 0.76);
  border-radius: 17px;
  pointer-events: none;
}

.skin-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  width: 54px;
  height: 54px;
  border: 4px solid #180913;
  border-radius: 12px;
  background: linear-gradient(145deg, #6e9bff, #215ad4);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-heavy);
  font-size: 34px;
  line-height: 1;
  text-shadow: var(--outline-2);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.34), 0 5px 0 rgba(0, 0, 0, 0.32);
}

.skin-shop-header,
.skin-card-shell {
  position: relative;
  z-index: 1;
}

.skin-shop-header {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  margin: 0 64px 4px;
}

.skin-modal h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(44px, 8vw, 76px);
  line-height: 0.95;
  text-align: center;
  text-shadow: var(--outline-3);
}

.skin-balance {
  position: absolute;
  left: 0;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 5px 12px;
  border: 3px solid rgba(24, 9, 19, 0.78);
  border-radius: 11px;
  background: rgba(19, 91, 72, 0.78);
  color: #fff;
  font-size: clamp(20px, 3.2vw, 30px);
  line-height: 1;
  text-shadow: var(--outline-2);
  transform: translateY(-50%);
}

.skin-balance .trophy-inline-icon {
  width: 32px;
  height: 32px;
}

.skin-reset-timer {
  position: absolute;
  top: 50%;
  right: 0;
  display: grid;
  grid-template-columns: 44px auto;
  grid-template-areas:
    "icon label"
    "icon timer";
  align-items: center;
  justify-items: start;
  column-gap: 4px;
  row-gap: 6px;
  padding: 3px 6px 4px 2px;
  border: 2px solid rgba(24, 9, 19, 0.8);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 42%),
    rgba(145, 54, 105, 0.78);
  color: #fff;
  line-height: 1;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.22),
    0 3px 0 rgba(0, 0, 0, 0.25);
  transform: translateY(-50%);
}

.skin-reset-timer > span {
  grid-area: icon;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  line-height: 1;
  text-shadow: none;
  filter:
    drop-shadow(-1px 0 0 rgba(0, 0, 0, 0.85))
    drop-shadow(1px 0 0 rgba(0, 0, 0, 0.85))
    drop-shadow(0 -1px 0 rgba(0, 0, 0, 0.85))
    drop-shadow(0 1px 0 rgba(0, 0, 0, 0.85))
    drop-shadow(0 2px 0 rgba(0, 0, 0, 0.32));
}

.skin-reset-timer > span img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.skin-reset-timer em {
  grid-area: label;
  color: #c8ddff;
  font-size: clamp(14px, 1.85vw, 21px);
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.92),
    -1px -1px 0 rgba(0, 0, 0, 0.92),
    1px -1px 0 rgba(0, 0, 0, 0.92),
    -1px 1px 0 rgba(0, 0, 0, 0.92),
    1px 1px 0 rgba(0, 0, 0, 0.92),
    -2px 0 0 rgba(0, 0, 0, 0.82),
    2px 0 0 rgba(0, 0, 0, 0.82),
    0 -2px 0 rgba(0, 0, 0, 0.82),
    0 2px 0 rgba(0, 0, 0, 0.82);
}

.skin-reset-timer strong {
  grid-area: timer;
  justify-self: start;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: #fff;
  font-size: clamp(15px, 2.15vw, 22px);
  line-height: 0.9;
  text-shadow: var(--outline-2);
  white-space: nowrap;
}

.skin-reset-time-rest {
  margin-left: 0;
}

.skin-list {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-rows: 110px;
  gap: 14px;
  flex: 0 1 auto;
  max-width: 100%;
  height: auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 8px 10px;
  cursor: default;
  scrollbar-width: none;
  touch-action: manipulation;
  user-select: none;
}

.skin-list::-webkit-scrollbar {
  display: none;
}

.skin-list.is-dragging {
  cursor: default;
}

.skin-scrollbar {
  display: none;
}

.skin-card-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-row: span 2;
  min-height: 0;
  border-radius: 16px;
}

.skin-overlay-active .skin-card-shell .glowing-wrapper {
  z-index: 0;
  overflow: visible;
}

.skin-overlay-active .skin-card-shell .glowing-wrapper,
.skin-overlay-active .skin-card-shell .glowing-container,
.skin-overlay-active .skin-card-shell .glowing-container--blur-wrapper,
.skin-overlay-active .skin-card-shell .glowing-border,
.skin-overlay-active .skin-card-shell .glowing-border::after {
  border-radius: 18px;
}

.skin-card {
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto 46px;
  gap: 5px;
  min-height: 0;
  height: 100%;
  padding: 10px;
  border: 0;
  border-radius: 16px;
  background-color: var(--skin-dark);
  background:
    radial-gradient(circle at 32% 14%, rgba(255, 255, 255, 0.58), transparent 18%),
    linear-gradient(180deg, color-mix(in srgb, var(--skin-pop, var(--skin-color)), white 14%) 0%, color-mix(in srgb, var(--skin-pop, var(--skin-color)), var(--skin-dark) 22%) 48%, color-mix(in srgb, var(--skin-dark), black 8%) 100%);
  box-shadow:
    inset 0 5px 0 rgba(255, 255, 255, 0.26),
    inset 0 0 0 2px rgba(255, 255, 255, 0.2),
    0 6px 0 rgba(0, 0, 0, 0.22),
    0 0 18px color-mix(in srgb, var(--skin-color), transparent 48%);
  overflow: hidden;
}

.skin-card::before,
.skin-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.skin-card::before {
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(116deg, rgba(255, 255, 255, 0.2), transparent 34%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 6px, transparent 6px 24px);
}

.skin-card::after {
  z-index: 0;
  left: 0;
  right: 0;
  bottom: 54px;
  height: 78px;
  background: linear-gradient(180deg, transparent, rgba(24, 9, 19, 0.5));
}

.skin-card > * {
  position: relative;
  z-index: 1;
}

.skin-card-badge {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  min-width: 58px;
  padding: 6px 10px 5px;
  border: 3px solid #180913;
  border-radius: 999px;
  background: linear-gradient(180deg, #9fc3ff, #4a8bff);
  color: #fff;
  font-family: var(--font-heavy);
  font-size: 17px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  -webkit-text-stroke: 0;
  paint-order: normal;
  text-shadow:
    -2px 0 0 #180913,
    2px 0 0 #180913,
    0 -2px 0 #180913,
    0 2px 0 #180913,
    -2px -2px 0 #180913,
    2px -2px 0 #180913,
    -2px 2px 0 #180913,
    2px 2px 0 #180913,
    0 3px 0 #180913,
    0 5px 0 rgba(24, 9, 19, 0.44);
  transform: rotate(-4deg);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.6),
    0 3px 0 rgba(0, 0, 0, 0.28),
    0 0 12px rgba(255, 74, 181, 0.52);
}

.skin-card-badge.is-daily {
  background: linear-gradient(180deg, #70ffe6, #2effd2);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.6),
    0 3px 0 rgba(0, 0, 0, 0.28),
    0 0 12px rgba(255, 181, 46, 0.52);
}

.skin-card { --skin-pop: var(--skin-color); }

.skin-card[data-skin-card="skater_cap"] {
  background-color: #5896ff;
  background:
    radial-gradient(circle at 30% 14%, rgba(255, 255, 255, 0.68), transparent 18%),
    linear-gradient(135deg, #4f8eff 0%, #3fffd9 22%, #63eff5 42%, #45d1ff 62%, #5cb7ff 82%, #5896ff 100%);
  box-shadow:
    inset 0 5px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 0 2px rgba(255, 255, 255, 0.24),
    0 6px 0 rgba(0, 0, 0, 0.22),
    0 0 20px rgba(255, 88, 200, 0.55),
    0 0 30px rgba(69, 216, 255, 0.36);
}

.skin-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  margin: -6px -6px 0;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.68), transparent 28%),
    radial-gradient(circle at 50% 82%, rgba(24, 9, 19, 0.22), transparent 42%),
    rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.skin-card.has-skin-image {
  grid-template-rows: minmax(0, 1fr) auto 46px;
}

.skin-card.has-skin-image .skin-preview {
  margin: -6px -6px 0;
  border-radius: 14px 14px 10px 10px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.72), transparent 26%),
    radial-gradient(circle at 50% 82%, rgba(24, 9, 19, 0.24), transparent 44%),
    rgba(255, 255, 255, 0.14);
}

.skin-preview-image {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: block;
  width: auto;
  height: 176px;
  max-width: none;
  object-fit: contain;
  object-position: center top;
  filter: drop-shadow(0 7px 0 rgba(0, 0, 0, 0.18));
  transform: translateX(-50%);
}

.skin-card[data-skin-card="bunny_runner"] .skin-preview-image {
  height: 150px;
  bottom: -6px;
}

.skin-card[data-skin-card="default"] .skin-preview-image {
  height: 264px;
  bottom: -108px;
}

.skin-card[data-skin-card="street_runner"] .skin-preview-image {
  height: 158px;
  bottom: -4px;
}

.skin-card[data-skin-card="skater_cap"] .skin-preview-image {
  height: 246px;
  bottom: -92px;
}

.skin-card[data-skin-card="pirate"] .skin-preview-image {
  height: 262px;
  bottom: -104px;
}

.skin-card[data-skin-card="pirate"] .skin-preview {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 242, 136, 0.72), transparent 27%),
    radial-gradient(circle at 50% 82%, rgba(213, 28, 37, 0.34), transparent 44%),
    linear-gradient(180deg, rgba(255, 72, 64, 0.34), rgba(232, 29, 38, 0.28));
}

.skin-card[data-skin-card="winter_hero"] .skin-preview-image {
  top: 50%;
  bottom: auto;
  width: 84%;
  height: auto;
  transform: translate(-50%, -50%);
}

.skin-model-preview {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  pointer-events: none;
}

.skin-card.has-skin-image .skin-copy {
  position: relative;
  margin-top: 0;
}


.skin-figure {
  position: relative;
  width: 48px;
  height: 80px;
  border: 5px solid #180913;
  border-radius: 22px 22px 16px 16px;
  background: linear-gradient(180deg, var(--skin-color), var(--skin-dark));
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.16),
    0 6px 0 rgba(0, 0, 0, 0.24);
}

.skin-figure::before,
.skin-figure::after {
  content: "";
  position: absolute;
  background: #180913;
}

.skin-figure::before {
  top: -30px;
  left: 50%;
  width: 46px;
  height: 42px;
  border: 5px solid #180913;
  border-radius: 50%;
  background: color-mix(in srgb, var(--skin-color), white 28%);
  transform: translateX(-50%);
}

.skin-figure::after {
  right: -22px;
  bottom: 18px;
  width: 14px;
  height: 48px;
  border-radius: 12px;
  box-shadow: -76px 0 0 #180913, -51px 43px 0 -1px #180913, -22px 43px 0 -1px #180913;
  transform: rotate(-11deg);
}

.skin-copy strong,
.skin-copy span,
.skin-buy {
  font-family: var(--font-heavy);
  text-shadow: var(--outline-2);
}

.skin-copy {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 4px;
  color: #fff;
  min-height: 0;
  text-align: center;
}

.skin-copy strong {
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 0.95;
  text-align: center;
}

.skin-copy span {
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1;
}

.skin-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
  min-height: 46px;
  border: 4px solid #180913;
  border-radius: 13px;
  background: linear-gradient(180deg, #fff478, #ffb52e);
  color: #fff;
  cursor: pointer;
  font-size: clamp(15px, 1.55vw, 20px);
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.38), 0 5px 0 rgba(0, 0, 0, 0.25);
}

.skin-buy .trophy-inline-icon {
  width: 28px;
  height: 28px;
  transform: translate(-3px, -2px) scale(1.15);
}

.skin-buy:disabled {
  cursor: default;
  filter: grayscale(0.25);
  opacity: 0.78;
}

.skin-buy.equipped {
  background: linear-gradient(180deg, #91f4ff, #2f9dff);
}

.skin-buy.reward-only,
.skin-buy.reward-only:disabled {
  background: linear-gradient(110deg, #4b7cff, #35ffce, #4effe0, #5ee2ea, #51d5ff, #71c4ff, #659fff);
  filter: none;
  opacity: 1;
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.38), 0 5px 0 rgba(0, 0, 0, 0.25);
}
html:where(html:not(.has-touch-controls)):not(.has-touch-controls) .skin-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    max-height: var(--game-popup-max-height);
    transform: translate(-50%, -50%) scale(var(--game-popup-scale));
    transform-origin: center;
  }
html:where(html:not(.has-touch-controls)):not(.has-touch-controls) .skin-modal {
    width: min(1040px, var(--game-popup-max-width));
  }

:where(html.has-touch-controls) .icon-button.skin .skin-icon-slot {
    top: -3px;
    width: 50px;
    height: 27px;
  }

:where(html.has-touch-controls) .skin-icon-image {
    width: 42px;
    height: 42px;
    transform: translateY(-1px);
  }

:where(html.has-touch-controls) .icon-button.skin strong {
    right: 3px;
    bottom: 6px;
    left: 3px;
    font-size: 6px;
  }

:where(html.has-touch-controls) .skin-modal {
    width: min(580px, calc(100vw - 86px));
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 14px);
    padding: 7px 8px 8px;
    border-width: 3px;
    border-radius: 14px;
  }

:where(html.has-touch-controls) .skin-modal::before {
    inset: 8px;
    border-width: 3px;
    border-radius: 11px;
  }

:where(html.has-touch-controls) .skin-close {
    top: 9px;
    right: 10px;
    width: 42px;
    height: 42px;
    border-width: 3px;
    border-radius: 10px;
    font-size: 28px;
  }

:where(html.has-touch-controls) .skin-shop-header {
    min-height: 50px;
    margin: 0 45px 5px 6px;
    justify-content: center;
  }

:where(html.has-touch-controls) .skin-modal h2 {
    margin: 0;
    font-size: clamp(28px, 9vw, 44px);
    line-height: 1;
  }

:where(html.has-touch-controls) .skin-balance {
    gap: 4px;
    left: 0;
    margin: 0;
    padding: 2px 7px 3px;
    border-width: 2px;
    border-radius: 8px;
    font-size: 14px;
    text-shadow: var(--outline-1);
  }

:where(html.has-touch-controls) .skin-balance .trophy-inline-icon {
    width: 22px;
    height: 22px;
  }

:where(html.has-touch-controls) .skin-reset-timer {
    grid-template-columns: 28px auto;
    column-gap: 3px;
    row-gap: 4px;
    padding: 2px 4px 3px 2px;
  border-width: 2px;
  border-radius: 7px;
  }

:where(html.has-touch-controls) .skin-reset-timer > span {
    width: 28px;
    height: 28px;
  }

:where(html.has-touch-controls) .skin-reset-timer em {
    font-size: 10px;
  }

:where(html.has-touch-controls) .skin-reset-timer strong {
    font-size: 11px;
    text-shadow: var(--outline-1);
  }

:where(html.has-touch-controls) .skin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-rows: clamp(64px, 13.5vh, 82px);
    gap: 7px;
    height: auto;
    min-height: 0;
    padding: 6px;
  }

:where(html.has-touch-controls) .skin-scrollbar {
    display: none;
  }

:where(html.has-touch-controls) .skin-card-shell {
    grid-row: span 2;
    border-radius: 11px;
  }

:where(html.has-touch-controls) .skin-card {
    grid-template-rows: 78px auto 38px;
    gap: 5px;
    min-height: 0;
    padding: 6px;
    border-radius: 11px;
  }

:where(html.has-touch-controls) .skin-card-badge {
    top: 7px;
    left: 7px;
    min-width: 44px;
    padding: 4px 7px 3px;
    border-width: 2px;
    font-size: 12px;
  }

:where(html.has-touch-controls) .skin-overlay-active .skin-card-shell .glowing-wrapper,
  :where(html.has-touch-controls) .skin-overlay-active .skin-card-shell .glowing-container,
  :where(html.has-touch-controls) .skin-overlay-active .skin-card-shell .glowing-container--blur-wrapper,
  :where(html.has-touch-controls) .skin-overlay-active .skin-card-shell .glowing-border,
  :where(html.has-touch-controls) .skin-overlay-active .skin-card-shell .glowing-border::after {
    border-radius: 13px;
  }

:where(html.has-touch-controls) .skin-preview {
    border-radius: 9px;
  }

:where(html.has-touch-controls) .skin-card.has-skin-image {
    grid-template-rows: 92px auto 38px;
    gap: 4px;
    min-height: 0;
  }

:where(html.has-touch-controls) .skin-card.has-skin-image .skin-preview {
    margin: -1px -1px 0;
    border-radius: 9px 9px 7px 7px;
  }

:where(html.has-touch-controls) .skin-preview-image {
    bottom: 0;
    height: 108px;
    max-width: 94%;
    transform: translateX(-50%);
  }

:where(html.has-touch-controls) .skin-card[data-skin-card="bunny_runner"] .skin-preview-image {
    height: 94px;
    bottom: -5px;
  }

:where(html.has-touch-controls) .skin-card[data-skin-card="default"] .skin-preview-image {
    height: 158px;
    bottom: -68px;
  }

:where(html.has-touch-controls) .skin-card[data-skin-card="street_runner"] .skin-preview-image {
    height: 82px;
    max-width: 86%;
    bottom: 0;
  }

:where(html.has-touch-controls) .skin-card[data-skin-card="skater_cap"] .skin-preview-image {
    height: 148px;
    bottom: -56px;
  }

:where(html.has-touch-controls) .skin-card[data-skin-card="pirate"] .skin-preview-image {
    height: 158px;
    bottom: -66px;
  }

:where(html.has-touch-controls) .skin-card[data-skin-card="winter_hero"] .skin-preview-image {
    top: 50%;
    bottom: auto;
    width: 90%;
    height: auto;
    transform: translate(-50%, -50%);
  }

:where(html.has-touch-controls) .skin-card.has-skin-image .skin-copy {
    margin-top: 0;
  }

:where(html.has-touch-controls) .skin-figure {
    transform: scale(0.68);
  }

:where(html.has-touch-controls) .skin-copy {
    gap: 4px;
  }

:where(html.has-touch-controls) .skin-copy strong {
    font-size: clamp(15px, 4.8vw, 20px);
    text-shadow: var(--outline-1);
  }

:where(html.has-touch-controls) .skin-copy span {
    font-size: 13px;
    text-shadow: var(--outline-1);
  }

:where(html.has-touch-controls) .skin-buy {
    margin-top: 3px;
    min-height: 38px;
    gap: 4px;
    border-width: 3px;
    border-radius: 9px;
    font-size: 13px;
    text-shadow: var(--outline-1);
  }

:where(html.has-touch-controls) .skin-buy .trophy-inline-icon {
    width: 20px;
    height: 20px;
  }

@media (orientation: portrait) {
  :where(html.has-touch-controls) .skin-modal {
    width: min(520px, calc(100vw - 28px));
    padding: 8px 8px 9px;
  }

  :where(html.has-touch-controls) .skin-close {
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
    font-size: 25px;
  }

  :where(html.has-touch-controls) .skin-shop-header {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    grid-template-areas:
      "title title"
      "balance reset";
    gap: 6px;
    align-items: center;
    min-height: 0;
    margin: 0 0 6px;
    padding-right: 2px;
  }

  :where(html.has-touch-controls) .skin-modal h2 {
    grid-area: title;
    justify-self: center;
    width: calc(100% - 90px);
    min-width: 0;
    padding: 0;
    font-size: clamp(27px, 10vw, 40px);
  }

  :where(html.has-touch-controls) .skin-balance,
  :where(html.has-touch-controls) .skin-reset-timer {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    max-width: 100%;
    transform: none;
  }

  :where(html.has-touch-controls) .skin-balance {
    grid-area: balance;
    justify-self: start;
    min-width: 0;
    padding: 2px 6px 3px;
    font-size: 13px;
  }

  :where(html.has-touch-controls) .skin-balance .trophy-inline-icon {
    width: 20px;
    height: 20px;
  }

  :where(html.has-touch-controls) .skin-reset-timer {
    grid-area: reset;
    justify-self: end;
    grid-template-columns: 24px minmax(0, auto);
    column-gap: 2px;
    row-gap: 3px;
    min-width: 0;
    padding: 2px 4px 3px 1px;
  }

  :where(html.has-touch-controls) .skin-reset-timer > span {
    width: 24px;
    height: 24px;
  }

  :where(html.has-touch-controls) .skin-reset-timer em {
    overflow: hidden;
    max-width: 78px;
    font-size: 9px;
    text-overflow: ellipsis;
  }

  :where(html.has-touch-controls) .skin-reset-timer strong {
    gap: 2px;
    font-size: 10px;
  }

  :where(html.has-touch-controls) .skin-list {
    height: auto;
  }

  :where(html.has-touch-controls) .skin-scrollbar {
    display: none;
  }
}

@media (orientation: landscape) {
  :where(html.has-touch-controls) .skin-modal {
    width: min(720px, calc(100vw - 86px));
    padding: 6px 8px 8px;
  }

  :where(html.has-touch-controls) .skin-shop-header {
    min-height: 38px;
    margin: 0 42px 4px 4px;
  }

  :where(html.has-touch-controls) .skin-modal h2 {
    font-size: clamp(24px, 5vw, 34px);
  }

  :where(html.has-touch-controls) .skin-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: clamp(53px, 15vh, 66px);
    gap: 6px;
    padding: 5px;
  }

  :where(html.has-touch-controls) .skin-card {
    grid-template-rows: minmax(0, 1fr) auto 30px;
    gap: 3px;
    padding: 5px;
  }

  :where(html.has-touch-controls) .skin-card.has-skin-image {
    grid-template-rows: minmax(0, 1fr) auto 30px;
  }

  :where(html.has-touch-controls) .skin-preview-image {
    height: 82px;
  }

  :where(html.has-touch-controls) .skin-card[data-skin-card="bunny_runner"] .skin-preview-image {
    height: 82px;
    bottom: -3px;
  }

  :where(html.has-touch-controls) .skin-card[data-skin-card="default"] .skin-preview-image,
  :where(html.has-touch-controls) .skin-card[data-skin-card="skater_cap"] .skin-preview-image,
  :where(html.has-touch-controls) .skin-card[data-skin-card="pirate"] .skin-preview-image {
    height: 104px;
    bottom: -38px;
  }

  :where(html.has-touch-controls) .skin-card[data-skin-card="street_runner"] .skin-preview-image {
    height: 68px;
  }

  :where(html.has-touch-controls) .skin-copy strong {
    font-size: clamp(13px, 3.2vw, 17px);
  }

  :where(html.has-touch-controls) .skin-buy {
    min-height: 30px;
    margin-top: 1px;
    border-width: 2px;
    border-radius: 8px;
    font-size: 12px;
  }

  :where(html.has-touch-controls) .math-quiz-modal {
    width: min(640px, calc(100vw - 144px));
  }

  :where(html.has-touch-controls) .math-quiz-form {
    width: min(410px, 100%);
  }

  :where(html.has-touch-controls) .math-quiz-keypad {
    width: min(520px, 100%);
    gap: 7px;
  }

  :where(html.has-touch-controls) .math-quiz-keypad button {
    min-height: 38px;
    border-radius: 9px;
    font-size: 18px;
  }
}

@media (orientation: landscape) {

  .has-touch-controls .math-quiz-modal {
    width: min(640px, calc(100vw - 144px));
  }

  .has-touch-controls .math-quiz-form {
    width: min(410px, 100%);
  }

  .has-touch-controls .math-quiz-keypad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(360px, 100%);
    gap: 7px;
  }

  .has-touch-controls .math-quiz-keypad button {
    min-height: 38px;
    border-radius: 9px;
    font-size: 18px;
  }
}

:where(html.has-touch-controls) .emoji-hud-icon.character-hud-icon {
    top: 0;
  }

:where(html.has-touch-controls) .emoji-hud-icon.character-hud-icon img {
    width: 35px;
    height: 29px;
  }

:where(html.has-touch-controls) .emoji-hud-button.character-hud-button strong {
    font-size: 8px;
  }
.has-touch-controls:where(html.has-touch-controls) .skin-card-shell,
  :where(html.has-touch-controls) .skin-card-shell,
  .has-touch-controls:where(html.has-touch-controls) .skin-copy,
  :where(html.has-touch-controls) .skin-copy,
  .has-touch-controls:where(html.has-touch-controls) .skin-copy strong,
  :where(html.has-touch-controls) .skin-copy strong {
    overflow: visible !important;
  }
.has-touch-controls:where(html.has-touch-controls) .skin-copy,
  :where(html.has-touch-controls) .skin-copy {
    position: relative;
    z-index: 4;
    display: grid;
    min-width: 0;
    min-height: 32px;
    align-content: center;
    padding: 5px 3px 6px;
    margin: -5px -3px -6px;
  }
.has-touch-controls:where(html.has-touch-controls) .skin-copy strong,
  :where(html.has-touch-controls) .skin-copy strong {
    display: block;
    max-width: 100%;
    padding: 0.14em 0.16em 0.2em;
    margin: -0.14em -0.16em -0.2em;
    font-size: clamp(15px, 4.25vw, 19px);
    line-height: 1.2;
    text-align: center;
    text-overflow: clip !important;
    white-space: nowrap;
  }

@media (orientation: portrait) {
  .has-touch-controls:where(html.has-touch-controls) .skin-card,
  :where(html.has-touch-controls) .skin-card,
  .has-touch-controls:where(html.has-touch-controls) .skin-card.has-skin-image,
  :where(html.has-touch-controls) .skin-card.has-skin-image {
    grid-template-rows: minmax(0, 1fr) minmax(34px, auto) 40px;
    gap: 3px;
  }

  .has-touch-controls:where(html.has-touch-controls) .skin-list,
  :where(html.has-touch-controls) .skin-list {
    grid-auto-rows: clamp(68px, 13.8vh, 84px);
    padding: 8px 8px 12px;
  }
}
@media (orientation: landscape) {

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-modal h2,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-modal h2 {
    font-size: clamp(18px, 2.7vw, 22px) !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-form button,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-form button {
    font-size: 12px !important;
    text-shadow: var(--outline-1) !important;
  }
}
@media (orientation: landscape) {

  html.has-touch-controls:not(.is-tablet-device) #mathQuizOverlay {
    box-sizing: border-box !important;
    padding: 8px 76px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-modal,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-modal {
    width: min(430px, 100%) !important;
    max-height: calc(100dvh - 16px) !important;
    padding: 4px 9px 5px !important;
    border-width: 3px !important;
    border-radius: 11px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-modal::before {
    inset: 3px !important;
    border-width: 1px !important;
    border-radius: 7px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-close {
    top: 4px !important;
    right: 5px !important;
    width: 26px !important;
    height: 26px !important;
    border-width: 2px !important;
    border-radius: 6px !important;
    font-size: 16px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-kicker,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-kicker {
    margin: -1px 0 4px !important;
    font-size: 8px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-modal h2,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-modal h2 {
    margin: 0 28px 4px !important;
    font-size: 14px !important;
    line-height: 0.9 !important;
    text-shadow: var(--outline-1) !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-progress,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-progress {
    margin: 0 0 5px !important;
    font-size: 9px !important;
    line-height: 1 !important;
    text-shadow: var(--outline-1) !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-question,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-question {
    width: min(250px, 100%) !important;
    margin: 2px auto 3px !important;
    padding: 3px 6px 2px !important;
    border-width: 2px !important;
    border-radius: 7px !important;
    font-size: 28px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-form {
    width: min(250px, 100%) !important;
    grid-template-columns: minmax(0, 1fr) 60px !important;
    gap: 4px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-answer-field,
  html.has-touch-controls:not(.is-tablet-device) .math-quiz-answer-field input,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-answer-field,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-answer-field input {
    height: 25px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-answer-field input {
    border-width: 2px !important;
    border-radius: 6px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-answer-field::after {
    inset: -3px 5px !important;
    font-size: 15px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-form button,
  html.has-touch-controls:not(.is-tablet-device) .is-hearts-quiz .math-quiz-form button {
    border-width: 2px !important;
    border-radius: 6px !important;
    font-size: 9px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-keypad {
    width: min(220px, 100%) !important;
    gap: 3px !important;
    margin-top: 4px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-keypad button {
    min-height: 20px !important;
    padding: 0 3px !important;
    border-width: 1px !important;
    border-radius: 5px !important;
    font-size: 11px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 2px 0 rgba(0, 0, 0, 0.26) !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-feedback {
    min-height: 8px !important;
    margin-top: 1px !important;
    font-size: 8px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-dots {
    gap: 3px !important;
    margin-top: 0 !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-dots span {
    width: 6px !important;
    height: 6px !important;
    border-width: 1px !important;
  }

  html.has-touch-controls:not(.is-tablet-device) .math-quiz-kicker,
  html.has-touch-controls:not(.is-tablet-device) .math-quiz-modal h2,
  html.has-touch-controls:not(.is-tablet-device) .math-quiz-progress,
  html.has-touch-controls:not(.is-tablet-device) .math-quiz-answer-field::after,
  html.has-touch-controls:not(.is-tablet-device) .math-quiz-form button,
  html.has-touch-controls:not(.is-tablet-device) .math-quiz-keypad button,
  html.has-touch-controls:not(.is-tablet-device) .math-quiz-feedback {
    text-shadow: var(--outline-1) !important;
  }
}

@keyframes character-lock-bob { 0%,100% { transform:rotate(-2deg); } 50% { transform:translateY(-1px) rotate(1deg) scale(1.03); } }
/* Local HUD placement. */
.skins-shop-launcher { position:fixed; top:calc(50% + 73px); left:calc(env(safe-area-inset-left,0px) + 14px); z-index:31; pointer-events:none; }
.skins-shop-launcher button, .character-menu-launcher button { pointer-events:auto; }
.character-menu-launcher { position:fixed; right:calc(env(safe-area-inset-right,0px) + 16px); bottom:calc(env(safe-area-inset-bottom,0px) + 94px); z-index:31; }
#skinOverlay, #characterOverlay { z-index:90; }
#mathQuizOverlay { z-index:95; }
.skin-modal, .character-modal, .math-quiz-modal { font-family:var(--font-heavy); }
.skin-modal h2 { font-family:var(--font-heavy); }
.skin-modal .trophy-inline-icon, .character-modal .trophy-inline-icon { display:inline-block; width:24px; height:24px; object-fit:contain; vertical-align:middle; }
.skin-balance .trophy-inline-icon { width:32px; height:32px; }
html.is-escaping .skins-shop-launcher, html.is-escaping .character-menu-launcher { opacity:0; pointer-events:none; }
html.is-escaping .skins-shop-launcher button, html.is-escaping .character-menu-launcher button { pointer-events:none; }
@media(max-width:700px) { :where(html.has-touch-controls) .character-menu-launcher {right:10px;bottom:94px;} }
@media(max-height:520px) { :where(html.has-touch-controls) .character-menu-launcher {right:10px;bottom:55px;} }

/* Anchor the left menu below the multiplier box. */
:root {
  --left-hud-lift: -40px;
  --left-menu-top: calc(clamp(142px, 19vh, 184px) + 150px);
  --left-menu-step: 84px;
}
.speed-multiplier-panel,
.trail-shop-launcher,
.player-trail-shop-launcher,
.emoji-hud-slot,
.skins-shop-launcher,
.daily-rewards-launcher {
  translate: 0 var(--left-hud-lift);
}
.trail-shop-launcher { top: var(--left-menu-top); }
.player-trail-shop-launcher { top: calc(var(--left-menu-top) + var(--left-menu-step)); }
.emoji-hud-slot { top: calc(var(--left-menu-top) + 4 * var(--left-menu-step)); transform: none; }
.skins-shop-launcher { top: calc(var(--left-menu-top) + 2 * var(--left-menu-step)); }
.daily-rewards-launcher { top: calc(var(--left-menu-top) + 3 * var(--left-menu-step)); }

:root:where(html.has-touch-controls) { --left-menu-step: 56px; }

:where(html.has-touch-controls) .skins-shop-launcher { left: calc(env(safe-area-inset-left, 0px) + 10px); }
@media (max-width: 720px) {
  :root:where(html.has-touch-controls) { --left-menu-top: calc(clamp(142px, 19vh, 184px) + 145px); }
}
@media (orientation: portrait) {
  :root:where(html.has-touch-controls) { --left-hud-lift: -16px; --left-menu-top: calc(env(safe-area-inset-top, 0px) + 166px); }
}

/* Share collection button sizing and flow with Active Animals. */
.collection-menu-button.character-hud-button > img {
  transform: translateY(-6px) scale(1.1);
}
.collection-menu-button.character-hud-button strong {
  position: absolute;
  bottom: 3px;
  left: 0;
  right: 0;
  color: #fff;
  font: bold 14px/1 var(--font-heavy);
  text-align: center;
  -webkit-text-stroke: 0;
  paint-order: stroke fill;
}
:where(html.has-touch-controls) .collection-menu-button.character-hud-button strong { font-size: 8px; }

/* Original Character menu shading, with blue surfaces shifted to green. */
#characterOverlay .character-modal {
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.72), transparent 33%),
    linear-gradient(160deg, #c2f6b0 0%, #a5e9b7 48%, #75ca95 100%);
}
#characterOverlay .character-title-box {
  background: linear-gradient(180deg, #b9ffc2 0%, #57ce79 100%);
}
#characterOverlay .character-preview-shell {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.36), transparent 57%),
    #c4f3cc;
}
#characterOverlay .character-arrow {
  border-color: #092e1b;
  background: linear-gradient(145deg, #287d49 0%, #104c2d 100%);
  box-shadow: inset 0 5px 0 rgba(145, 239, 175, 0.36), 0 6px 0 rgba(6, 47, 25, 0.38);
}
#characterOverlay .character-arrow:active {
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.62), 0 3px 0 rgba(7, 77, 34, 0.32);
}
#characterOverlay .character-close {
  background: linear-gradient(145deg, #76df91, #218f48);
}
#characterOverlay .character-palette-swatch.is-selected { outline-color: #80eaa1; }
#characterOverlay .character-palette-buy { background: linear-gradient(#77f797, #36d569); }
#characterOverlay .character-arrow span {
  background-image: url('../assets/icons/character-arrow-white-ai.webp');
  /* The generated PNG is flattened; clip its exterior at the arrow silhouette. */
  clip-path: polygon(45.8% 32%, 45.8% 20%, 46.6% 17%, 48.5% 14.4%,
    51.3% 12.4%, 54.4% 11.7%, 57.5% 12%, 60.4% 13.4%, 63% 15.4%,
    92.3% 44.1%, 94% 47%, 94.7% 50%, 94% 53.3%, 92.2% 56.2%,
    63% 84.8%, 60.4% 87.5%, 57.5% 89%, 54.4% 89.4%, 51.3% 88.8%,
    48.5% 87%, 46.6% 84.3%, 45.8% 81%, 45.8% 69.2%, 18% 69.2%,
    14.7% 68.5%, 12.1% 66.5%, 10.5% 63.8%, 9.8% 60.5%, 9.8% 40.3%,
    10.5% 37%, 12.1% 34.4%, 14.7% 32.7%, 18% 32%);
}

/* Fitted portraits for the six-skin mosaic. */
.skin-card .skin-preview-image {
  height: 100%;
  max-width: 100%;
  object-position: center bottom;
}

@media (max-width: 600px) {
  :where(html.has-touch-controls) .skin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 90px;
    gap: 8px;
    padding: 6px;
  }
  :where(html.has-touch-controls) .skin-card,
  :where(html.has-touch-controls) .skin-card.has-skin-image {
    grid-template-rows: minmax(0, 1fr) 32px 38px;
    padding: 6px;
    gap: 4px;
  }
  :where(html.has-touch-controls) .skin-copy strong { font-size: 16px; }
  :where(html.has-touch-controls) .skin-buy { min-height: 38px; font-size: 14px; margin-top: 0; }
  :where(html.has-touch-controls) .skin-modal { padding: 8px; }
  :where(html.has-touch-controls) .skin-shop-header { min-height: 58px; margin: 0 44px 4px; }
  :where(html.has-touch-controls) .skin-modal h2 { font-size: 34px; }
  :where(html.has-touch-controls) .skin-balance { left: -34px; padding: 4px; font-size: 14px; }
  :where(html.has-touch-controls) .skin-close { width: 36px; height: 36px; font-size: 24px; top: 12px; right: 12px; }
}

/* Varied tile placement; card contents retain their original vertical design. */
.skin-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas: "second feature third fifth" "fourth feature banner banner";
  grid-template-rows: repeat(2, 234px);
  grid-auto-rows: 234px;
}
.skin-list > .skin-card-shell { grid-row: auto; min-width: 0; }
.skin-list > .skin-card-shell:nth-child(1) { grid-area: feature; }
.skin-list > .skin-card-shell:nth-child(2) { grid-area: second; }
.skin-list > .skin-card-shell:nth-child(3) { grid-area: third; }
.skin-list > .skin-card-shell:nth-child(4) { grid-area: fourth; }
.skin-list > .skin-card-shell:nth-child(5) { grid-area: fifth; }
.skin-list > .skin-card-shell:nth-child(6) { grid-area: banner; }
@media (max-width: 600px), (orientation: portrait) {
  :where(html.has-touch-controls) .skin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "second feature" "fourth feature" "third fifth" "banner banner";
    grid-template-rows: repeat(4, 140px);
    gap: 8px;
  }
}
@media (orientation: landscape) {
  :where(html.has-touch-controls) .skin-list { grid-template-rows: repeat(2, 138px); gap: 6px; }
}
