.modal :is(
  .daily-reward-visual,
  .offline-reward-visual,
  .sell-reward-visual,
  .loss-cut-visual,
  .analyst-hire-visual,
  .work-tutorial-visual,
  .first-buy-visual,
  .milestone-reward-visual,
  .retirement-story-image,
  .bonus-confirm-visual,
  .feature-hero-visual,
  .feature-scene-host:not([data-feature-scene="ranking"]),
  .share-reward-visual,
  .boost-choice-option
) {
  background: #e8f3ff !important;
  isolation: isolate;
}

img[data-image-state="loading"],
img.is-loading {
  opacity: 0 !important;
}

img[data-image-state="ready"],
img.is-ready {
  opacity: 1;
}

img[data-image-state="error"],
img.is-error {
  opacity: 0 !important;
}

body.has-open-modal #starter-mini-coach,
body.has-open-modal #ant-scene-dialogue {
  visibility: hidden !important;
}

body:not([data-active-panel="home"]):not([data-active-panel="milestones"]) #avatar-scene {
  display: none !important;
}

body[data-active-panel="home"] #avatar-scene {
  display: flex !important;
  width: min(calc(100% - 40px), 720px);
  margin: 14px auto 0 !important;
}

.launch-character-art {
  width: auto !important;
  height: min(40dvh, 370px) !important;
}

.launch-loader-title,
#splash .splash-content h1.launch-surface-title {
  top: max(calc(env(safe-area-inset-top) + 18px), min(132px, 15.5dvh)) !important;
  width: clamp(270px, min(76vw, 52dvh), 480px) !important;
}

.launch-title-text {
  font-size: clamp(36px, min(10.8vw, 8.8dvh), 64px) !important;
}

body[data-active-panel="home"] #avatar-scene[data-residence] #ant-avatar-wrap {
  position: absolute !important;
  inset: auto 0 3px !important;
  width: 115px !important;
  height: 150px !important;
  margin: 0 auto !important;
  transform: none !important;
  transform-origin: center bottom !important;
}

body[data-active-panel="home"] #avatar-scene[data-residence] #ant-avatar {
  width: 115px !important;
  height: 150px !important;
}

body[data-active-panel="milestones"] #avatar-scene[data-residence] #ant-avatar-wrap {
  position: absolute !important;
  inset: auto 0 4px !important;
  width: 130px !important;
  height: 146px !important;
  margin: 0 auto !important;
}

body[data-active-panel="milestones"] #avatar-scene[data-residence] #ant-avatar {
  width: 112px !important;
  height: 146px !important;
}

:is([data-character-render="approved-b-raster"], [data-character-render^="tier-raster-"]) :is(.ant-vector-base, .ant-vector-face),
.ant-vector-base,
.ant-vector-face {
  display: none !important;
}

:is([data-character-render="approved-b-raster"], [data-character-render^="tier-raster-"]) :is(.acc:not(.neutral-tier-headwear), .cosmetic) {
  display: none !important;
}

:is([data-character-render="approved-b-raster"], [data-character-render^="tier-raster-"]) .neutral-tier-headwear {
  display: none;
}

:is([data-character-render="approved-b-raster"], [data-character-render^="tier-raster-"]) :is(
  #acc-watch,
  .cosmetic
):not(.hidden)[data-rig-compatible="true"],
:is([data-character-render="approved-b-raster"], [data-character-render^="tier-raster-"]) :is(
  #acc-mythic-power-suit,
  #acc-galaxy-emperor-robe
):not(.hidden) {
  display: block !important;
}

#ant-avatar:is([data-character-render="approved-b-raster"], [data-character-render^="tier-raster-"]) #ant-character-b {
  filter: var(--ant-tier-filter, none);
  transform-box: fill-box;
  transform-origin: 50% 92%;
}

body[data-active-panel="home"] #avatar-scene:not([data-ant-action]) #ant-character-b {
  animation: approvedAntIdleV166 5.2s ease-in-out infinite;
}

#ant-avatar[data-character-tier="worker"] { --ant-tier-filter: saturate(1.06) brightness(1.02); }
#ant-avatar[data-character-tier="office-worker"] { --ant-tier-filter: saturate(1.03) brightness(0.99); }
#ant-avatar[data-character-tier="manager"] { --ant-tier-filter: saturate(1.08) brightness(0.96); }
#ant-avatar[data-character-tier="rich"] { --ant-tier-filter: saturate(1.14) brightness(0.94); }
#ant-avatar[data-character-tier="super"] { --ant-tier-filter: saturate(1.18) brightness(1.01); }
#ant-avatar[data-character-tier="king"] { --ant-tier-filter: sepia(0.10) saturate(1.20) brightness(1.03); }
#ant-avatar[data-character-tier="chaebol"] { --ant-tier-filter: saturate(1.12) brightness(0.90); }
#ant-avatar[data-character-tier="emperor"] { --ant-tier-filter: sepia(0.22) saturate(1.28) brightness(1.08); }
#ant-avatar[data-character-tier="mythic"] { --ant-tier-filter: sepia(0.30) saturate(1.34) brightness(1.13); }

#topbar .tier-ant-mark[data-tier="1"] .tier-ant-img { filter: saturate(1.06) brightness(1.02); }
#topbar .tier-ant-mark[data-tier="2"] .tier-ant-img { filter: saturate(1.03) brightness(0.99); }
#topbar .tier-ant-mark[data-tier="3"] .tier-ant-img { filter: saturate(1.08) brightness(0.96); }
#topbar .tier-ant-mark[data-tier="4"] .tier-ant-img { filter: saturate(1.14) brightness(0.94); }
#topbar .tier-ant-mark[data-tier="5"] .tier-ant-img { filter: saturate(1.18) brightness(1.01); }
#topbar .tier-ant-mark[data-tier="7"] .tier-ant-img { filter: sepia(0.10) saturate(1.20) brightness(1.03); }
#topbar .tier-ant-mark[data-tier="8"] .tier-ant-img { filter: sepia(0.22) saturate(1.28) brightness(1.08); }
#topbar .tier-ant-mark[data-tier="9"] .tier-ant-img { filter: sepia(0.30) saturate(1.34) brightness(1.13); }

#ant-avatar-wrap.ant-happy #ant-character-b {
  animation: approvedAntHappyV166 560ms ease-out;
}

#ant-avatar-wrap.ant-sad #ant-character-b {
  animation: approvedAntSadV166 500ms ease-in-out;
}

@keyframes approvedAntIdleV166 {
  0%, 72%, 100% { transform: translateY(0) rotate(0); }
  82% { transform: translateY(-2px) rotate(-0.35deg); }
  91% { transform: translateY(0) rotate(0.35deg); }
}

@keyframes approvedAntHappyV166 {
  0%, 100% { transform: translateY(0) scale(1); }
  44% { transform: translateY(-6px) scale(1.018); }
}

@keyframes approvedAntSadV166 {
  0%, 100% { transform: translateX(0) rotate(0); }
  35% { transform: translateX(-2px) rotate(-1deg); }
  70% { transform: translateX(2px) rotate(1deg); }
}

#avatar-scene .ant-scene-dialogue,
#avatar-scene .ant-action-cue {
  position: absolute;
  z-index: 14;
  top: 10px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 24px);
  min-height: 40px;
  margin: 0 !important;
  padding: 9px 13px;
  transform: translateX(-50%);
  border: 1px solid #d1d6db;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(25, 31, 40, 0.09);
  color: #191f28;
  text-align: center;
}

#avatar-scene .ant-scene-dialogue strong,
#avatar-scene .ant-action-cue strong {
  display: block;
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 20px;
  white-space: normal;
  word-break: keep-all;
}

#avatar-scene .ant-action-cue {
  display: block;
  border-color: #90bfff;
  background: #edf5ff;
}

#avatar-scene .ant-action-cue.hidden,
#avatar-scene .ant-scene-dialogue.hidden,
#avatar-scene[data-ant-action] .ant-scene-dialogue {
  display: none !important;
}

#avatar-scene .ant-action-avatar {
  display: none !important;
}

body[data-quest-priority="action"][data-quest-mission] .quest-focus {
  outline: 3px solid #f5b544 !important;
  outline-offset: 3px !important;
  animation: questTargetPulseV166 1.25s ease-in-out infinite !important;
}

@keyframes questTargetPulseV166 {
  0%, 100% {
    filter: brightness(1);
    box-shadow: 0 0 0 2px rgba(245, 181, 68, 0.22), 0 0 10px rgba(245, 181, 68, 0.24) !important;
  }
  50% {
    filter: brightness(1.06);
    box-shadow: 0 0 0 6px rgba(245, 181, 68, 0.34), 0 0 20px rgba(245, 181, 68, 0.48) !important;
  }
}

#panel-home {
  padding-top: 12px;
}

.home-command-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 4px 0 12px;
  border-bottom: 1px solid #e5e8eb;
}

.home-command-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.home-command-head span {
  color: #6b7684;
  font-size: 12px;
  font-weight: 650;
}

.home-command-head strong {
  color: #191f28;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

#home-stock-btn {
  min-height: 44px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: #3182f6;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

#panel-home #action-buttons {
  display: grid !important;
  width: 100% !important;
  margin: 0 !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  justify-content: center !important;
  justify-self: center !important;
}

#panel-home #action-buttons button,
#panel-home #action-buttons button.action-primary {
  display: grid !important;
  min-width: 0;
  min-height: 76px !important;
  padding: 7px !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 34px auto auto !important;
  row-gap: 2px !important;
  place-content: center !important;
  place-items: center !important;
  overflow: hidden !important;
  border: 1px solid #e5e8eb !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #4e5968 !important;
  box-shadow: none !important;
}

#panel-home #work-btn:not(:disabled) {
  border-color: #3182f6 !important;
  color: #191f28 !important;
}

#panel-home #action-buttons button::before,
#panel-home #action-buttons button.action-primary::before {
  content: "" !important;
  display: block !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: center !important;
  justify-self: center !important;
  margin: 0 !important;
  position: static !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--button-icon) center / contain no-repeat !important;
  filter: none !important;
  box-shadow: none !important;
}

#panel-home #action-buttons button::after {
  display: none !important;
}

#panel-home #action-buttons :is(.action-label, .action-status) {
  grid-column: 1 !important;
  width: max-content !important;
  max-width: 100% !important;
  justify-self: center !important;
  position: static !important;
  text-align: center !important;
  white-space: nowrap !important;
}

#panel-home #action-buttons .action-label {
  grid-row: 2 !important;
  font-size: 14px !important;
  line-height: 17px !important;
}

#panel-home #action-buttons .action-status {
  grid-row: 3 !important;
  font-size: 11px !important;
  line-height: 13px !important;
}

body[data-starter-phase="work"] #panel-home .home-command-head {
  display: none;
}

body[data-active-panel="home"][data-starter-phase="work"] #avatar-scene {
  order: 1 !important;
}

body[data-active-panel="home"][data-starter-phase="work"] #main-screen {
  order: 3 !important;
}

body[data-starter-phase="work"] #panel-home #action-buttons {
  grid-template-columns: minmax(0, 1fr) !important;
}

body[data-starter-phase="work"] #panel-home #action-buttons > :not(#work-btn) {
  display: none !important;
}

body[data-starter-phase="buy"] #avatar-scene,
body[data-starter-phase="sell"] #avatar-scene,
body[data-starter-phase="analyst"] #avatar-scene {
  display: none !important;
}

#buy-sheet-confirm,
#sell-sheet-confirm {
  border-color: #3182f6 !important;
  background: #3182f6 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  box-shadow: none !important;
}

body .life-preview-items b {
  font-size: 13px;
}

@media (max-width: 380px), (max-width: 699px) and (max-height: 800px) {
  body[data-active-panel="home"] #avatar-scene {
    min-height: 182px !important;
    height: 182px !important;
  }

  body[data-active-panel="home"] #avatar-scene[data-residence] #ant-avatar-wrap,
  body[data-active-panel="home"] #avatar-scene[data-residence] #ant-avatar {
    width: 90px !important;
    height: 117px !important;
  }

  body[data-active-panel="home"] #main-screen {
    padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
  }
}

@media (min-width: 700px) {
  .launch-character-art {
    height: min(47dvh, 440px) !important;
  }

  body[data-active-panel="home"] #avatar-scene[data-residence] #ant-avatar-wrap,
  body[data-active-panel="home"] #avatar-scene[data-residence] #ant-avatar {
    width: 165px !important;
    height: 215px !important;
  }

  body[data-active-panel="milestones"] #avatar-scene[data-residence] #ant-avatar-wrap {
    width: clamp(148px, 18vw, 170px) !important;
    height: clamp(172px, 20vw, 194px) !important;
  }

  body[data-active-panel="milestones"] #avatar-scene[data-residence] #ant-avatar {
    width: clamp(130px, 15vw, 146px) !important;
    height: clamp(168px, 19.5vw, 190px) !important;
  }

  #panel-home #action-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 900px) and (max-height: 820px) {
  body[data-active-panel="home"] #avatar-scene[data-residence] #ant-avatar-wrap,
  body[data-active-panel="home"] #avatar-scene[data-residence] #ant-avatar {
    width: 132px !important;
    height: 172px !important;
  }

  body[data-active-panel="milestones"] #avatar-scene[data-residence] #ant-avatar-wrap {
    width: 146px !important;
    height: 162px !important;
  }

  body[data-active-panel="milestones"] #avatar-scene[data-residence] #ant-avatar {
    width: 124px !important;
    height: 158px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  img[data-image-state="ready"],
  img.is-ready {
    transition: none;
  }

  #ant-avatar-wrap.ant-happy #ant-character-b,
  #ant-avatar-wrap.ant-sad #ant-character-b,
  #avatar-scene[data-ant-action] #ant-character-b,
  #avatar-scene:not([data-ant-action]) #ant-character-b {
    animation: none;
  }

  body[data-quest-priority="action"][data-quest-mission] .quest-focus {
    animation: none !important;
  }
}
