.role-change-prompt {
  position: fixed;
  left: 50%;
  bottom: 132px;
  z-index: 23;
  display: grid;
  gap: 2px;
  min-width: 190px;
  padding: 9px 12px;
  border: 1px solid rgba(107, 188, 255, 0.42);
  border-radius: 7px;
  background: rgba(8, 13, 11, 0.86);
  color: #eef3ec;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.role-change-prompt.hidden,
.role-change-panel.hidden,
#deathRoleChangeHint.hidden,
#deathRoleChangeButton.hidden {
  display: none !important;
}

.role-change-prompt span {
  color: #b8c8ba;
  font-size: 12px;
}

.role-change-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 45;
  box-sizing: border-box;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid rgba(238, 243, 236, 0.16);
  border-radius: 8px;
  background: rgba(12, 18, 15, 0.96);
  color: #eef3ec;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

.role-change-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.role-change-head button,
.role-change-list button,
#deathRoleChangeButton {
  border: 1px solid rgba(238, 243, 236, 0.16);
  border-radius: 7px;
  background: rgba(238, 243, 236, 0.08);
  color: #eef3ec;
  font: inherit;
  cursor: pointer;
}

#roleChangeHint {
  margin: 10px 0 12px;
  color: #b8c8ba;
  font-size: 13px;
}

.role-change-list {
  display: grid;
  gap: 8px;
}

.role-change-card {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(238, 243, 236, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.role-change-card.active {
  border-color: rgba(107, 188, 255, 0.45);
  background: rgba(107, 188, 255, 0.08);
}

.role-change-card.inactive {
  opacity: 0.5;
  filter: saturate(0.62);
}

.role-change-card.inactive:hover,
.role-change-card.inactive:focus-within {
  opacity: 0.74;
  filter: saturate(0.82);
}

.role-change-select {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px;
  text-align: left;
}

.role-change-select.inactive {
  background: rgba(238, 243, 236, 0.045);
}

.role-change-select.active,
.role-change-choice.active {
  border-color: rgba(107, 188, 255, 0.75);
  background: rgba(107, 188, 255, 0.16);
}

.role-change-choice.inactive-role-choice {
  border-color: rgba(238, 243, 236, 0.12);
  background: rgba(238, 243, 236, 0.045);
  color: rgba(238, 243, 236, 0.72);
}

.role-change-choice.inactive-role-choice.active {
  border-color: rgba(107, 188, 255, 0.32);
  background: rgba(107, 188, 255, 0.06);
}

.role-change-list span {
  color: #b8c8ba;
  font-size: 12px;
}

.role-change-slots {
  display: grid;
  gap: 6px;
}

.role-change-slot {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 7px;
}

.role-change-slot-label {
  color: #aebeb3;
  font-size: 11px;
  font-weight: 900;
}

.role-change-slot-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.role-change-choice {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

#deathRoleChangeButton {
  margin-top: 10px;
  padding: 9px 12px;
}

#deathRoleChangeHint {
  display: block;
  margin-top: 10px;
  color: #b8c8ba;
  font-size: 12px;
}

.mobile-action.role-change {
  position: fixed;
  left: calc(max(28px, env(safe-area-inset-left)) + 154px);
  bottom: calc(max(28px, env(safe-area-inset-bottom)) + 40px);
  width: 68px;
  height: 68px;
  border-color: rgba(255, 209, 102, 0.62);
  background: rgba(70, 56, 18, 0.78);
  color: #fff2bd;
  font-size: 13px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 209, 102, 0.16);
}

.mobile-action.role-change.hidden {
  display: none;
}
